7

The Phonegap/Cordova documentation by and large does a great job of explaining the purpose of the various intents and other bits in the config.xml file. However, I have been unable to establish the meaning/use of the following

<platform name="android">
    <allow-intent href="market:*" />
</platform>
<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
</platform>

I'd be most grateful to anyone who might be able to explain what they are meant to do.

DroidOS
  • 8,530
  • 16
  • 99
  • 171

1 Answers1

12

From the whitelist plugin documentation:

Intent Whitelist

Controls which URLs the app is allowed to ask the system to open. By default, no external URLs are allowed.

On Android, this equates to sending an intent of type BROWSEABLE.

This whitelist does not apply to plugins, only hyperlinks and calls to window.open().

Basically, it is what types urls are allowed to be opened with window.open(), so in your example:

<platform name="android">
    <allow-intent href="market:*" />
</platform>
<platform name="ios">
    <allow-intent href="itms:*" />
    <allow-intent href="itms-apps:*" />
</platform>

the app would be able to open the Android Play Store and App store on iOS. The links (market:) will allow links to other apps in the play store (see Stack overflow question How to open the Google Play Store directly from my Android application?), and the (itms:) allows links to apps in the itunes App Store. This is probably required if you using any advertising plugin that redirects users to install apps. These url schemes are pre-registered in Andriod and iOS by Google and Apple respectively.

Community
  • 1
  • 1
Kris Erickson
  • 33,454
  • 26
  • 120
  • 175
  • Yes but what do market:, itms: etc actually do? I can see what sms: does, or what tel: does but market etc is not at all clear. – DroidOS Oct 11 '15 at 14:36
  • 1
    Market allows opening of an app's page in the google play store (it used to be called the Android Market), see: http://stackoverflow.com/questions/11753000/how-to-open-the-google-play-store-directly-from-my-android-application . itms allows opening of ios app pages in the itunes app store. – Kris Erickson Oct 11 '15 at 22:11
  • thanks . write that up as an answer and I will accept + upvote it. – DroidOS Oct 12 '15 at 07:51