cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julio cesar sanchez <jcesarmob...@gmail.com>
Subject opinion about a bug fix
Date Sat, 16 Jul 2016 16:02:22 GMT
I'm looking into this issue https://issues.apache.org/jira/browse/CB-11178

The problem is on iOS 9 you can no longer query for schemes unless you add
them to the info.plist under the LSApplicationQueriesSchemes key.

When the inAppBrowser plugin is called with _system option this code is
called:

*- (**void**)openInSystem:(**NSURL***)url*

*{*

    *if** ([[**UIApplication* *sharedApplication**] **canOpenURL**:url]) {*

*        [[**UIApplication* *sharedApplication**] **openURL**:url];*

*    } **else** { **// handle any custom schemes to plugins*

*        [[**NSNotificationCenter* *defaultCenter**] **postNotification**:[*
*NSNotification* *notificationWithName**:*
*CDVPluginHandleOpenURLNotification* *object**:url]];*

*    }*

*}*


So, it fails on iOS 9 as fb scheme is not in the info.plist


I have 3 options here:


1. Document that on iOS 9 you have to add the urls to the info.plist

2. Document that you don't need inAppBrowser plugin to open a 3rd party
app, you just need to use an a tag element with the url scheme on the href

3. Change the code to

*- (**void**)openInSystem:(**NSURL***)url*

*{*

  *     [[**UIApplication* *sharedApplication**] **openURL**:url];*

*}*

This will open the app without querying, but we miss the else. I'm not sure
why that code is there or if it's used anywhere, it's been there since the
beginning of the github repo, it sends a notification with the url scheme
in case some other plugin can do something with the url scheme, but I don't
think it makes much sense as you are trying to open an external app and
that code is to handle the url inside the app.

So, opinions?

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message