The following article describes the process for using Deeplinking in iOS9 and above and iOS Universal Links. It is important that you configure both for it to work successfully.
Follow these steps:
iOS requires a secure connection between the app to its associated domains. To establish this secure connection between your app and your OneLink’s domain, AppsFlyer automatically creates and places a file called apple-app-site-association on this domain with the Bundle Identifier and App ID Prefix of your app.
The App ID Prefix appears by going to Identifiers >> App IDs on Apple's Developer Portal.
The Bundle ID appears on the app’s target -> General on Xcode and also as the app identifier in the Apple developer center. AppsFlyer automatically fetches it from the App Store, unless your app is not yet in the store and then you are required to set it manually using the OneLink configuration.
Go to your AppsFlyer OneLink Configuration page:
NOTE: You must complete these three steps before continuing to the Associated Domains stage.
- Enable Universal Links
- Enter your App ID Prefix
- Click Save & Close
Preparing Your App
Creating a Provisioning Profile
Provided your app is already registered on Apple’s Developer Center, you must enable Associated Domains on your app’s Identifier.
Enabling Associated Domains:
1. Go to Identifiers >> App IDs and select your app and enable Associate Domains:
2. You must generate your provisioning files for your app, download them and double-click to install them on Xcode.
Configuring Your App
NOTE: You must complete the OneLink Configuration before continuing with the next steps.
- Go to Xcode and select your app target.
- In the Capabilities section, enable Associate Domains.
- Add you app's OneLink domain as configured on the OneLink configuration. It must be prefixed by applinks. For example: applinks:mydomain.onelink.me
- The sub-domain (“mydomain” in the example) is your sub-domain on OneLink.
Now your app and configuration are set, you can generate a OneLink URL through Media Source Configuration >> Integrated Partners and use it to deeplink into your app.
As long as OneLink is enabled, the links generated have your selected domain (example: myapp.onelink.me) which deeplinks into your app when installed.
NOTE: It is only possible to test a deeplink on a real device. Make sure you delete the app from the device before running it with the Associate Domain changes.
Using iOS Test App
If you are using an iOS test app and have already set up Universal Links, you can configure the live app's OneLink URL to debug your iOS app. Clicking on OneLink on a device that contains the debug app opens up the debug app with Universal links, providing the debug app is installed on the device and the live app isn't.
- On the OneLink Configuration page set the Enable Universal Links for deeplinking toggle button to On.
- Set the Add test apps configuration toggle button to On.
- Enter the test app's App ID prefix and the iOS App Bundle ID, repeat this process for each app you want to test.
However, if you don't have an iOS test app, should you build it or not?
If Safari opens, instead of the app - try to delete the app and run it again. If the problem persists, try to add another row on the Associate Domains (so it is changed). Then, delete the app and repeat the process.
Make sure your OneLink has the same domain as set on the app.
- If you have configured Universal Deeplinking for iOS9 the Shorten Link button on the AppsFlyer dashboard is greyed out and cannot be used.
- Due to an iOS limitation universal links do not open apps when they are set into the browser address bar, including Safari.
- Apple requires that Universal Links be tapped on directly by the end user. This means that OneLink can't be wrapped for click tracking, be redirected to or be triggered programmatically.