14
votes

I have been trying to get dynamic links working all day to no success.

I have created a dynamic link using firebase web and with a google provided link. I have added the associated domains as instructed (applinks:https://myapp.page.link/sZZL), and also have firebase hosting set up.

On firebase I have checked the Team ID and App store ID (its not released to the app store, but in uploaded to apple developer account and so has an ID) are correct.

The url type is set up correctly, with the bundle id set.

If I open the link in chrome, it redirects to the app just fine.

I've tried sending a email with the link and adding it to notes and opening from there. All open the app preview page which then redirects to the app store.

Thee app is not on the app store yet as it is in development - would this impact it?

I simply want it to redirect to the app (which is on the phone in question) rather than the app store

3
Would you try debug like a https://myapp.page.link/sZZL?d=1 ? See firebase.google.com/docs/dynamic-links/debug .zkohi
Please find better answers in this linkPratik Patel

3 Answers

12
votes

To get your dynamic links to work properly on iOS, you need to set up:

  1. associated domains This property sets up in custom entitlements file and looks like

<key>com.apple.developer.associated-domains</key>
<array>
    <string>applinks:myapp.page.link</string>
</array>
  1. Url types In info.plist add URL types that firebase will use by default

<key>CFBundleURLTypes</key>
<array>
    .... Some others url schemes
    <dict>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>CFBundleURLName</key>
        <string>Bundle ID</string>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>your.bundle.id</string>
        </array>
    </dict>
    ....
</array>

Also, you should add Team ID (required) and App Store ID (if your app not published, you can use App Store ID of any another app as a temporary solution, but also required)

For more information see firecast

For handling links in application use this

3
votes

Please check the link setup in associated domains. It should not include https or www.

For example:

It should be something like: "applinks:appname.page.link"

But it should not be something like: "applinks:https://appname.page.link" or "applinks:www.appname.page.link"

0
votes

I solved it using help from @Mark Iliev's answer, but my case was a bit different.

Initially I had a Firebase domain specified in the Associated Domains, like applinks:myproject.page.link.

Then I configured my custom domain to be used, and when I updated the associated domains section, XCode told me that a new entitlements file will be created, so it added a file MyProjectRelease.entitlements to the project with the updated Custom domain.

But, the original MyProject.entitlements file still had the old Firebase domain name present in it. Updating the domain in the new MyProject.entitlements to my custom domain solved this issue.

    <dict>
       <key>aps-environment</key>
       <string>development</string>
       <key>com.apple.developer.associated-domains</key>
       <array>
           <string>applinks:mycustomdomain.com</string>
       </array>
    </dict>