问题
I'm trying to integrate universal links in my iOS app. So whenever someone taps on <myapp>.herokuapp.com/content
gets redirected directly to app. I followed this guide for setup. I did the following setup but cannot get it working. I also checked other threads on stackoverflow but none of them solved the issue.
- Added Associated Domains in Capabilities Tab on my app's target. Added two domains:
activitycontinuation:<myapp>.herokuapp.com
andapplinks:<myapp>.herokuapp.com
. - In Build Phases > Copy Bundle Resources added the file .entitlements.
- Got teamId from https://developer.apple.com/account/#/membership
On my website added a route for
apple-app-site-association
athttps://<myapp>.herokuapp.com/apple-app-site-association
which returns the following json:{ "applinks": { "apps": [], "details": [ { "appID": "<teamId>.<bundleId>.dev", "paths": [ "*" ] }, { "appID": "<teamId>.<bundleId>", "paths": [ "*" ] } ] }, "activitycontinuation": { "apps": [ "<teamId>.<bundleId>.dev", "<teamId>.<bundleId>" ] } }
Installed app from Xcode to iPhone 6s Plus (physical device) with bundle id
<bundleId>.dev
and copied linkhttps://<myapp>.herokuapp.com/content
to Notes but it opens in Safari.
回答1:
Fixed the issue. The problem was that I was testing with Debug configuration. When I tried with Release build everything is now working fine.
回答2:
There are quite a lot of issues that could be preventing your Universal Links from working here.
Here are some things to double-check:
- Is the AASA file properly named, and properly signed?
- Are you testing with a physical device? (some say Universal Links now work consistently in the simulator with iOS 10, but I'd still use a physical device)
- Are your device and provisioning certificates all error-free?
- Could the AASA file have failed to update when the app was first installed/launched due to an issue with network connectivity (I find that the AASA will fail to download if Charles Proxy is capturing traffic, for example)
- When testing, are you first pasting the link into Notes and then long-pressing on it? Are you seeing the "Open in App" menu option? If so, Universal Linking is working properly and has just been disabled on the device.
I would also recommend running through Alex Austen's super blog post on this topic, as doing so may help you spot the problem (here: https://blog.branch.io/how-to-setup-universal-links-to-deep-link-on-apple-ios-9/).
Branch has a number of tools/resources for identifying Universal Linking issues. They are specifically intended for use with Branch links, but you may still find them helpful:
- AASA Validator: https://branch.io/resources/aasa-validator/
- Universal Link Validator: https://dev.branch.io/getting-started/universal-linking-validator/guide/
- Universal Linking Troubleshooting Guide: https://support.branch.io/support/solutions/articles/6000153326-ios-universal-links-troubleshooting-guide
回答3:
Paste your domain into this link and check that it doesn't have issues
来源:https://stackoverflow.com/questions/42469232/ios-universal-links-not-working-on-ios-10