Universal Links support
iOS requires a secure connection between an application and its associated domains. In order to establish such a connection, AppMetrica puts a file called apple-app-site-association on its domain. File contains Bundle ID and App Prefix applications.
Setting up Universal Links
To activate Universal Links for your app, follow these steps in the AppMetrica web interface:
- Go to the Applications section.
- Select the app and go to Settings.
Open the Main tab and enter your app's Bundle ID and App Prefix.
How to get the Bundle IDYou can find the Bundle ID in the Apple developer console, in . In Xcode, you can find it in .How to get the App PrefixYou can find the App Prefix in the Apple Developer Console. In most cases, the App Prefix is the same as the Team ID. This ID is also available in the Apple Developer Console (in the Member Center, click your name in the upper-right corner of the window and choose ).
- Set the Use Universal Link option to On and click Save settings. After this, you will see a link in the Universal Link field that looks like
applinks:<app_id>.redirect.appmetrica.yandex.com
, where<app_id>
is your app's ID in AppMetrica (application ID).
Preparing your app
If your app is already registered in the Apple Developer Center, go to the developer console and enable Associated Domains for the application ID:
- Go to.
- Select the app, then enable the Associated Domains option for the Development and Distribution columns.
Configuring your app
In the Xcode interface, follow these steps:
- Select the app target.
- In Capabilities, enable the Associated Domains option.
- In Domains, enter the Universal Link generated by AppMetrica.
Using a direct Universal Link
A direct Universal Link has the following format:
https://<application_id>.redirect.appmetrica.yandex.com/?appmetrica_tracking_id=<tracking_id>
Depending on the circumstances, clicking a link like this makes one of the following happen:
- The app opens, if it is already installed.
- The app's page in the App Store opens, if the app isn't installed.
Testing
Now your app is fully configured and you can use Universal Links. While the application included Universal Links, when referring to the domain of the view applinks:<app_id>.redirect.appmetrica.yandex.com
, will navigate directly to the app.
If Safari opens instead of the app, reinstall the app. If the problem persists, add a new Associated Domains row in Xcode (so it will change), and then reinstall the app.
Make sure that your link has the same domain as your app.