Skip to main content
Inspiring
May 1, 2014
Answered

AIR iOS URL Scheme

  • May 1, 2014
  • 2 replies
  • 3227 views

I'm developing an AIR for iOS app for my client to run on an iPad, and my app needs to be able to launch other apps using a URL scheme, and also to be launched by another app, by receiving a URL scheme from it. From what I have read, it would appear that AIR for iOS apps can receive and respond to URL schemes, but they cannot send URL schemes to launch other apps, due to security restrictions.

Does anyone know if it is possible to both send and receive URL schemes?

This topic has been closed for replies.
Correct answer User Unknow

Yes, you can.

Open installed "Wikitude" app can be done via this script

import flash.events.MouseEvent;

btn.addEventListener(MouseEvent.CLICK, callURL);

function callURL(e:MouseEvent):void{
    navigateToURL(new URLRequest("wikitude://"));
}

Same way you can open your app from any other. In example above Wikitude app it's URI id. The same as below iPadARIconAppB

Here is part of Application-xml.xml descriptor from my old project:

<iPhone>

    <InfoAdditions><![CDATA[

  <key>UIDeviceFamily</key>

  <array>

    <string>1</string>

    <string>2</string>

  </array>

  <key>CFBundleURLTypes</key>

  <array>

    <dict>

      <key>CFBundleURLName</key>

      <string>com.camel.geo.iPadARIconAppB.iPadARIconAppB-scheme</string>

      <key>CFBundleURLSchemes</key>

      <array>

        <string>iPadARIconAppB</string>

      </array>

    </dict>

  </array>

  <key>UIApplicationExitsOnSuspend</key>

  <true/>

]]></InfoAdditions>

    <requestedDisplayResolution>standard</requestedDisplayResolution>

  </iPhone>

You need to change CFBundleURLName to your app ID by my sample and CFBundleURLSchemes put there your own app name.

If you want open your app from any other - you must open "iPadARIconAppB://" and if you need pass params - just make "iPadARIconAppB://myparams" and read it via Invoke from Adobe Air.

Air is great and allow many things

2 replies

User Unknow
User UnknowCorrect answer
Legend
May 1, 2014

Yes, you can.

Open installed "Wikitude" app can be done via this script

import flash.events.MouseEvent;

btn.addEventListener(MouseEvent.CLICK, callURL);

function callURL(e:MouseEvent):void{
    navigateToURL(new URLRequest("wikitude://"));
}

Same way you can open your app from any other. In example above Wikitude app it's URI id. The same as below iPadARIconAppB

Here is part of Application-xml.xml descriptor from my old project:

<iPhone>

    <InfoAdditions><![CDATA[

  <key>UIDeviceFamily</key>

  <array>

    <string>1</string>

    <string>2</string>

  </array>

  <key>CFBundleURLTypes</key>

  <array>

    <dict>

      <key>CFBundleURLName</key>

      <string>com.camel.geo.iPadARIconAppB.iPadARIconAppB-scheme</string>

      <key>CFBundleURLSchemes</key>

      <array>

        <string>iPadARIconAppB</string>

      </array>

    </dict>

  </array>

  <key>UIApplicationExitsOnSuspend</key>

  <true/>

]]></InfoAdditions>

    <requestedDisplayResolution>standard</requestedDisplayResolution>

  </iPhone>

You need to change CFBundleURLName to your app ID by my sample and CFBundleURLSchemes put there your own app name.

If you want open your app from any other - you must open "iPadARIconAppB://" and if you need pass params - just make "iPadARIconAppB://myparams" and read it via Invoke from Adobe Air.

Air is great and allow many things

Inspiring
May 7, 2014

Thanks Anton, I can confirm that this works.

Colin Holgate
Inspiring
May 1, 2014

I haven't tried this, but what happens if you navigateToURL() to a custom url scheme address?