EddyVerbruggen / Custom-URL-scheme

:link: Launch your Cordova/PhoneGap app by a Custom URL scheme like mycoolapp://
1.03k stars 367 forks source link

In IOS, one app(with url scheme plugin) cannot be launched by another app(with inappbrowser plugin) #163

Open ron-liu opened 8 years ago

ron-liu commented 8 years ago

Hi,

This issue looks not true, but I tried many times and always the same case. I am describing all the details below, and please point me anything I was wrong, thanks. If you need any more information, let me know.

-- Cheers, Ron

Environment IPhone 6s on IOS 9.3 ionic 2.0.0-beta.23 (I am using ionic v1) cordova 6.1.0

Steps: 1 Create two ionic apps under /app:

mkdir /app && cd /app
ionic start handler tabs  # it will be the app to be launched
ionic start sender tabs  # it will be the app to be triggered and launch another app

2 In handler app, add custom-url-scheme plugin

cd /app/handler
ionic plugin add cordova-plugin-customurlscheme --variable URL_SCHEME=handler

3 In sender app, add inappbrowser plugins

cd /app/sender
ionic plugin add cordova-plugin-inappbrowser

4 In sender app, add one button to launch handler app, and another button to launch google site

<button ng-click='window.open('handler://', "_system")'>Open handler</button>
<button ng-click='window.open("http://www.google.com", "_system")'>Open google</button>

5 Test results:

I tried the exact same code on android, it all works fine.

bjoernbur commented 8 years ago

I'm having the same issue.

Any news about that? In my opinion it still could be a inappbrowser issue because the handling for the urls (normal url and app scheme) are different. What do you think?

pallaviMN commented 8 years ago

@ron-liu , i tried the same as u have done. But for me even in android its not working. Can u pls share the code of it?

pallaviMN commented 8 years ago

@ron-liu , i created same projects as you have created, but for me "Open Handler" or "Open Google" not working in android as well

ron-liu commented 8 years ago

This problem has been solved by referring this post: http://stackoverflow.com/questions/30987986/ios-9-not-opening-instagram-app-with-url-scheme.

Basically, it is because ios 9 changed the url scheme rule, which need a white list declaration on the sender part.

@pallaviMN I have done it successfully on both Android and Ios, please refer to the simple source: https://github.com/mashuo-io/communication-between-ionic-apps.