avioli / uni_links

Flutter plugin for accepting incoming links.
BSD 2-Clause "Simplified" License
563 stars 303 forks source link

iOS Universal linking doesn't seem to work #132

Closed nourski closed 3 years ago

nourski commented 3 years ago

I can't seem to get iOS universal links working. I've tried everything - deleting & re-installing, upgrading version number, trying different devices, simulator & real, and in each case the links open up in Safari instead of opening the app. Here are the steps I have taken to setup universal links:

  1. Uploaded apple-app-site-association to an https server with json content-type. You can see per the attached that it is appearing on Apple's CDN:
Screen Shot 2021-08-29 at 12 40 35 PM

I also validated the apple-app-site-association file via https://branch.io/resources/aasa-validator/ (worth noting that I was not able to validate with Apple's appsearch-validation-tool - received error: "Could not extract required information for Universal Links.")

  1. Added the associated domain in my project capabilities:
Screen Shot 2021-08-28 at 12 13 16 PM

Opening with /usr/bin/xcrun simctl openurl or clicking on the url on my mobile device (tried from notes app) still opens the url in safari instead of opening the app. I also followed the troubleshooting tips here: https://www.wwt.com/article/using-sysdiagnose-on-ios-to-troubleshoot-universal-links/ and found from my phone analytics logs that the app is not even reading the AASA file.

What could I be missing? Has anyone managed to get iOS universal linking to work?

kmoreau commented 3 years ago

Hello,

Do you have add :

"apps": [],

in your file 'apple-app-site-association' ?

"The apps key in an apple-app-site-association file must be present and its value must be an empty array, as shown in Listing 6-1." https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW2

Also check if you check 'Associated Domains' on your provisioning profile :)

I use the example code and it works on emulator and real device (via QRCode).

nourski commented 3 years ago

Hello,

Do you have add :

"apps": [],

in your file 'apple-app-site-association' ?

"The apps key in an apple-app-site-association file must be present and its value must be an empty array, as shown in Listing 6-1." https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html#//apple_ref/doc/uid/TP40016308-CH12-SW2

Also check if you check 'Associated Domains' on your provisioning profile :)

I use the example code and it works on emulator and real device (via QRCode).

@kmoreau thanks so much for your response! I actually figure out the issue and it was a rookie mistake on my end. Just for reference in case anyone else runs into this, I had only created entitlements for profile - didn't even notice I wasn't on the "all" tab on Xcode. Once I created for all (debug, release, profile) everything worked as expected.