Current State of Linking to Another App

  • 1
  • Question
  • Updated 5 years ago
Greetings PGB Friends,

I know this question has been asked a bunch of times and in various ways, but things keep changing over the years and many of the responses are either incomplete or out of date. So no flames please - I searched and searched and searched before writing this! Thanks for your help in advance.

I need to be able to link to another app that is installed on the device. What is the best way to do this as of January, 2016?

I have tried using this custom plugin: cordova-plugin-customurlscheme but when I render a link and set the href to "someotherapp://" the link does not work on iOS or Android. I tried using window.open and that doesn't work either.

For whitelist, I am using cordova-plugin-whitelist, of course, and I have tried adding and this does not help. I have also tried adding to no avail, as well as

Any guidance?
Photo of Alan Neveu

Alan Neveu, Champion

  • 213 Posts
  • 11 Reply Likes
  • basically psyched, just need a little help!

Posted 5 years ago

  • 1
Photo of Alan Neveu

Alan Neveu, Champion

  • 213 Posts
  • 11 Reply Likes
Gah, my tags disappeared... I tried adding allow-navigation, allow-intent, and access nodes in my config.xml. None of that is helping. I can see the link to the other app, but tapping on it does nothing at all.
Photo of Petra V.

Petra V., Champion

  • 7794 Posts
  • 1391 Reply Likes
Your tags would show, if you wrapped them in a CODE element, as described under "some HTML allowed".

The plugin 'cordova-plugin-customurlscheme' would be correct (which of course must be used in the called app, not the calling app).
The whitelist plugin (and possibly the inappbrowser plugin) need to be used in the calling app. AFAIK, if you use the inappbrowser plugin to call the other app, you don't need any additional whitelisting.

Make sure you don't use window.open(). See the inappbrowser on how to use it nowadays. The third function parameter would be '_system', I think.

BTW, Eddy, the author of cordova-plugin-customurlscheme, is usually friendly and helpful if you contact him directly through Github. Should the above not be enough (which might well be, since I don't use this construction myself), you may consider contacting Eddy.
Photo of Alan Neveu

Alan Neveu, Champion

  • 213 Posts
  • 11 Reply Likes
Ahh, nice little forehead smack here... I got things working now. Thanks for your help Petra. Moving along!