Skip to main content
adevforgama
Participant
January 28, 2016
Question

Universal Links in Air 19

  • January 28, 2016
  • 2 replies
  • 2429 views

According to the release notes (http://labsdownload.adobe.com/pub/labs/flashruntimes/shared/air19_flashplayer19_releasenotes.pdf‌) and a guide provided by Adobe (Adobe Developer Connection | Universal Links for iOS) Air 19 should support Universal Links in iOS 9.

Having completed all the steps I should be able to receive the url information via the InvokeEvent. However, while old openUrl style deeplinks still work I find that there is no handling for applinks.

As a point of reference I have:

  • enabled Associated Domains on my app regenerated a provisioning profile
  • hosted an apple-app-site-association file on my domain with correct formatting and signing
  • entered my root url (as applinks:root.url) into the iOS Entitlements under com.apple.developer.associated-domains

Right now, pointing to my site (for example root.url/foo/bar) will open the app but I only receive a standard invoke.

As an additional measure, I have attempted some Air hackery in an ANE. By swizzling (http://nshipster.com/method-swizzling/‌) the application:continueUserActivity:restorationHandler: selector in a category of the CTAppController I should be able to gain access to the NSUserActivity object but this method never appears to be called. I also tried this with application:didFinishLaunchingWithOptions: (while of course calling the original selector otherwise Air won't run!) which is properly called but launchOptions is always null when launching via my link.


Hope there is an answer out there to resolve this problem. Thanks.

edited for clarifications

This topic has been closed for replies.

2 replies

Inspiring
August 21, 2017

I'm having the same problem. The entitlements are added to the app ID and app template the links open the app, but they aren't present in the InvokeEvent parameters, and adding the handler to the appDelegate doesn't have an effect - the handler is never called, whether the app is running in the background or not - other handlers added to the appDelegate are working just fine. The JSON is correct, the site is accessible over HTTPS with a working certificate and indeed the associated domains are showing up as being approved in the iOS console when the app is installed on the device.

Did you ever find a solution to this?

sharp_idea16B8
Adobe Employee
Adobe Employee
January 29, 2016

Hi adevforgama, there are two invoke events generated. The first one doesn't contain any data. While the second one contains the url information. Have you checked the second invoke event? It should contain the required url information.

adevforgama
Participant
January 29, 2016

The app is not generating two events, only one.

NativeApplication.nativeApplication.addEventListener(InvokeEvent.INVOKE, function onMainInvoke(event:InvokeEvent):void {

  trace(event.reason + ' - ' + event.arguments);

});

Only gives me one instance of [trace] standard - in the console and no other messages.

adevforgama
Participant
January 29, 2016

For reference the formatting in my entitlements:


<key>com.apple.developer.associated-domains</key>
  <array>
    <string>applinks:www.foo.com</string>

  </array>


apple-app-site-association:


{

    "applinks": {

        "apps": [],

        "details": [

            {

                "appID": "TEAMID.com.COMPANY.GAME",

                "paths": [ "/foo*", "/bar*", "/baz/*" ]

            }

        ]

    }

}

and a link I am using to open the app:

https://www.foo.com/baz/2874bv8