[
https://issues.apache.org/jira/browse/CB-12002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16464649#comment-16464649
]
ASF GitHub Bot commented on CB-12002:
-------------------------------------
dpogue closed pull request #269: CB-12002 - Support LSApplicationQueriesSchemes
URL: https://github.com/apache/cordova-ios/pull/269
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/bin/templates/scripts/cordova/lib/prepare.js
b/bin/templates/scripts/cordova/lib/prepare.js
index 0beb95e60..b94ac8a7c 100644
--- a/bin/templates/scripts/cordova/lib/prepare.js
+++ b/bin/templates/scripts/cordova/lib/prepare.js
@@ -221,6 +221,19 @@ function updateProject (platformConfig, locations) {
delete infoPlist['NSAppTransportSecurity'];
}
+ // Add the <allow-intent> entries to LSApplicationQueriesSchemes
+ var intents = platformConfig.getAllowIntents();
+ var schemes = intents.reduce(function (collection, intent) {
+ var scheme = intent.href.split(':')[0];
+ if (scheme !== '*') {
+ collection.push(scheme);
+ }
+ return collection;
+ }, []);
+ if (schemes.length > 0) {
+ infoPlist['LSApplicationQueriesSchemes'] = schemes;
+ }
+
handleOrientationSettings(platformConfig, infoPlist);
updateProjectPlistForLaunchStoryboard(platformConfig, infoPlist);
diff --git a/tests/spec/unit/fixtures/test-config.xml
b/tests/spec/unit/fixtures/test-config.xml
index bb2d4f0af..ea1162951 100644
--- a/tests/spec/unit/fixtures/test-config.xml
+++ b/tests/spec/unit/fixtures/test-config.xml
@@ -126,6 +126,11 @@
<allow-navigation href="http://*" />
<allow-navigation href="https://*" />
+
+ <allow-intent href="https://*" />
+ <allow-intent href="myapp:*" />
+ <allow-intent href="*://*" />
+
<preference name="fullscreen" value="true" />
<preference name="webviewbounce" value="true" />
<preference name="orientation" value="portrait" />
diff --git a/tests/spec/unit/prepare.spec.js b/tests/spec/unit/prepare.spec.js
index 8bd8db214..a6e869530 100644
--- a/tests/spec/unit/prepare.spec.js
+++ b/tests/spec/unit/prepare.spec.js
@@ -1486,6 +1486,16 @@ describe('prepare', function () {
expect(exceptionDomains['undefined']).toBeUndefined();
});
});
+ /// ///////////////////////////////////////////////
+ it('<allow-intent> - should add to the list of app schemes', function
(done) {
+ wrapper(updateProject(cfg, p.locations), done, function () {
+ var schemes =
plist.build.mostRecentCall.args[0].LSApplicationQueriesSchemes;
+
+ expect(schemes.length).toBe(2);
+ expect(schemes[0]).toEqual('https');
+ expect(schemes[1]).toEqual('myapp');
+ });
+ });
it('Test#020 : <name> - should write out the display name to info
plist as CFBundleDisplayName', function (done) {
cfg.shortName = function () { return 'MyApp'; };
wrapper(updateProject(cfg, p.locations), done, function () {
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Support LSApplicationQueriesSchemes
> -----------------------------------
>
> Key: CB-12002
> URL: https://issues.apache.org/jira/browse/CB-12002
> Project: Apache Cordova
> Issue Type: Bug
> Components: cordova-ios
> Reporter: Darryl Pogue
> Assignee: Darryl Pogue
> Priority: Major
>
> For apps to launch other apps via their custom URL schemes, they need to be
> whitelisted in LSApplicationQueriesSchemes. We should be able to use the
> (currently unused by iOS) {{<allow-intent>}} tags in config.xml to configure
> this.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]