2

Hi I'm developing a phonegap + JQueryMobile app, which should be correctly executed on Android, iOs and WindowsPhone as well.

I need to exploit an external service which requires one callback URL to redirect the app to in case of success, and one in case of error (pretty common situation. In my case both will be local files, say www/success.html and www/error.html). Of course I could write different paths for each device (e.g. file:///android_asset/www/success.html on Android), but I'm wondering if the framework provides a more elegant and solution.

So the questions is, how can I get a unique absolute URL which allows me to perform a cross-platform HTTP redirection from a remote web page to a local file within a phonegap application?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
Marco Gagliardi
  • 565
  • 1
  • 8
  • 24

2 Answers2

0

Reltive paths should work:

index.html onError -> ./error.html index.html onSuccess -> ./success.html

Or am I missing a server interaction like:

index.html -> http://someserver.com -> error.html

In this case the serverinterction have to be async.

Christian Kuetbach
  • 15,850
  • 5
  • 43
  • 79
  • 1
    Thanks Christian.. yes there's an external server interaction. index.html -> http://extserver.com?success=&error= My app will require an external page, and this page will then do some work and redirect back to the url i had provided. Of course everything will be async, i just need to know what should i pass as a redirect url, in order that my phongap webview can correctly open a local file in the actual www directory of the app (no metter if the device is an iphone, an android or a windowsphone device) – Marco Gagliardi Oct 16 '12 at 17:37