Skip to main content

Apple Dynamic Links Setup

caution

Dart-only initialization is currently not supported on the Apple platform when using firebase_dynamic_links, please follow the Platform Setup section from the manual installation guide for the supported platforms.

Apple Account#

To setup Dynamic Links on iOS, it is a prerequisite that you have an Apple developer account setup.

Configure your App in the Firebase Console#

Add an App Store ID & Team ID to your app in your Firebase console. If you do not have an App Store ID yet, you can put any number in here for now. Your Team ID can be found in your Apple developer console.

Apple Configuration
Apple Configuration

Test the domain (e.g. https://your-dynamic-link-domain) you have created in your Firebase console. Go to the following location in your browser [your domain]/apple-app-site-association. The response will have a details array property containing an object that has the property appID. That will be your app's app ID (It may take some time for your domain to register). Please ensure it is registered before proceeding.

Apple Developer Console#

Create a provisioning profile for your app. Please ensure you've enabled the Associated Domain capability which you should check before proceeding.

Apple Provisioning Profile
Apple Provisioning Profile

Signing & Capabilities#

Open your app under the TARGETS header using XCode. Click the Signing & Capabilities tab. You will need to ensure your Team is registered, and your Provisioning Profile field is completed. Please add the domain you created in your Firebase console to the Associated Domains and prefix with applinks:

Signing & Capabilities
Signing & Capabilities

Click the Info tab, and add a URL Type to your project. The Identifier can be called Bundle Id or whatever you wish. Add your bundle identifier to the URL Schemes property.

URL Schemes
URL Schemes

Dynamic Links With Custom Domains#

If you have set up a custom domain for your Firebase project, you must add the dynamic link URL prefix into your iOS project's Info.plist file by using the FirebaseDynamicLinksCustomDomains key. You can add multiple URLs as well.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FirebaseDynamicLinksCustomDomains</key>
<array>
<string>https://custom.domain.io/path1</string>
<string>https://custom.domain.io/path2</string>
</array>
...other settings
</dict>
</plist>

If you don't add this, the dynamic link will invoke your app, but you cannot retrieve any deep link data you may need within your app, as the deep link will be completely ignored.

Test Dynamic Links#

To test your dynamic link, you will need to use a real device as it will not work on a simulator. You will also have to run the app in release mode (i.e. flutter run --release) as iOS will block you from opening the app in debug mode from a dynamic link.