0

How can i navigate back to a page in my android app after loading an external site.

1.Open app

2.In app user will go to an external link

3.External site has link,which take the user back to app.

How can i go to my application . I have tried to give "file:///android_asset/www/package.html" in href but its not working at all . Please suggest me and thank you in advance.,

sradha
  • 2,216
  • 1
  • 28
  • 48

1 Answers1

0
  1. First to open an external url in the users default browser (Install the InAppBrowser plugin) use the window.open('http://www.yoururl.com', '_system');

  2. To open your app from any browser install the Custom URL scheme Plugin launch your app by a link like this: <a href="mycoolapp://">Open App</a>

In config.xml of plugin change the value <param name="URL_SCHEME" value="mycoolapp" /> to <param name="URL_SCHEME" value="YOUR_CUSTOM_VALUE" />

Whebcraft
  • 168
  • 7
  • I have done following the steps,but i am getting an error,while clicking upon open App button,Its showing Application Error net::ERR_UNKNOWN_URL_SCHEME(mycoolapp://). Please suggest me. – sradha Jan 27 '16 at 06:37
  • But i am getting error ,while running this code in cmd cordova plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=mycoolapp can you plz tell me why the error "Error: Current working directory is not a Cordova-based project" is coming? – sradha Jan 27 '16 at 11:34
  • Remove the plugin and add it again – Whebcraft Jan 28 '16 at 08:03