Does Universal Links work with unsigned apple-app-site-association JSON?

I am setting up my apple-app-site-association file follow this tutorial: http://techlife.cookpad.com/entry/2014/12/11/093000

But it does not work.

I setup a free hosting site and upload the apple-app-site-association file onto the root of website: http://universallink.net46.net/apple-app-site-association

1. I created a JSON file and named it handoff.json:

{
  "applinks":
  {
       "apps":[],
       "details":
       {
            "XXXXXXXXXX.com.home.universallinks":
            {
                 "paths":["*"]
            }
       }
  }
}


The XXXXXXXXXX here is the team id of the Development provisioning profile (not the distribution one)


2. I used Keychain Access app to export a iPhone developerment certificate to a Certificates.p12 key.

3. I signed the JSON file with these commands:

Create a certificate in the openssl command.

openssl pkcs12 -in Certificates.p12 -clcerts -nokeys -out output_crt.pem

Create a secret key.

openssl pkcs12 -in Certificates.p12 -nocerts -nodes -out output_key.pem

Create an intermediate certificate.

openssl pkcs12 -in Certificates.p12 -cacerts -nokeys -out sample.ca-bundle

Sign the handoff.json file with the following command.

cat handoff.json | openssl smime -sign -inkey output_key.pem -signer output_crt.pem -certfile sample.ca-bundle -noattr -nodetach -outform DER> apple-app-site-association

4. I uploaded the signed file "apple-app-site-association" onto the root of website: http://universallink.net46.net/apple-app-site-association

5. I configured the entitlement:

<dict>
<key>com.apple.developer.associated-domains</key>
<array>
  <string>applinks:universallink.net46.net</string>
  <string>applinks:www.universallink.net46.net</string>
</array>
</dict>

6. I implement the function application:continueActivity.... and return YES.

7. I installed the app on the iOS 9 beta 4 device and also installed the Certificates.p12 at step 3 into the device.

8. I sent a message to myself: http://universallink.net46.net

9. I expected my app would be launched but actually, it was Safari.


I don't know if I did something wrong.

When you first install the app to your device from Xcode, you should be able to see the error message in the device console (*not* the Xcode console, the actual device log). That may provide some info for you. Be sure to also make sure you've added the associated domains in your project's Capabilities, as I didn't see you mention that in your list of "things I've done." Note also that this only works on device, not simulator, I believe.


I've also mentioned a tool I created in another portion of this thread that may be able to help you, if you haven't tried already. However, it sounds like your app isn't even attempting to make that request, so my tool may not be helpful for you yet.

So yeah, I just figured out the "on install" bit. Not sure how I feel about that, maybe they don't want us changing the applinks without submitting a new build?


So that does work but here's a new problem. When you link into an app ( I used a link from Messages) you get a breadcrumb back to messages but you also get one forward to the actual URL in Safari. I clicked this link to Safari and now all my deep links go straight to Safari. Finding no way to change this "Setting" I uninstalled and re-installed my app and . . . still goes to Safari. This can't be a permanent choice but I can't figure out how to undo it.

Re: only on install, yeah, this seems like a poor / unusable choice. Good luck ever pushing updates. I believe you can make a call in your code that will trigger the download again, though (something with the security library).


Re: dropping after working once, again, yeah, the whole thing seems *super* flakey. Only suggestion is try uninstall / reboot / install cycle, as bad as that sounds.


So, here's hoping this whole thing gets revisisted before / soon after launch. In its current state, there are a lot of things that don't work, or don't work every time, and it's just going to be a miserable experience for devs.

If anyone gets "stuck" going to Safari after clicking the breadcrumb, I may have figured it out. Someone will need to try and reproduce.


My landing page has the smart app banner on it and I notice it now has just an "open" instead of the usualy banner. Clicking this aprarantly changes your preference back to opening links in the app. Now, I dont know if this is beacuse I have the banner or if Safari is adding it. If its the later then your choice seems to be permanent. This seems like a pretty important point since the whole point of this to keep users IN the app.


I see they're trying to provide choices to the user but man, how is the averge user ever going to figure this out.

What you're saying sounds accurate; I believe the other developer who had mentioned this problem to me (one click worked, next didn't) ran into the same issue with the banner, though he hadn't even added the banner to the site to begin with.

Hi sss,


Well done on getting your tool through moderation! I appreciate that things have moved on a bit in the meantime but hopefully plenty found it on your GItHub when the need was greatest.


-Max

Thanks so much for this suggestion - I thought I was going crazy when it just stopped working.


Just had to tap that banner to 'Open in App' and Im back on track - phew

Does Universal Links work with unsigned apple-app-site-association JSON?
 
 
Q