16

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

user3024827
  • 1,228
  • 4
  • 18
  • 36
  • Would you try debug like a `https://myapp.page.link/sZZL?d=1` ? See https://firebase.google.com/docs/dynamic-links/debug . – zkohi Jun 28 '19 at 08:27
  • Please find better answers in this [link](https://stackoverflow.com/a/68472268/2530570) – Pratik Patel Jul 21 '21 at 15:26

5 Answers5

16

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

Mark Iliev
  • 194
  • 1
  • 4
3

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"

Shivani Bajaj
  • 996
  • 10
  • 23
2

I had the same issue that my app always went to the App Store page. The app was already live. I followed the complete instructions about Associated Domains etc, all setup was correct.

What my issue was that Firebase asks for Team ID & App ID. The Team ID is used in the apple-app-site-association so you would get something like:

{"applinks":{"apps":[],"details":[{"appID":"TEAMID.bundleID","paths":["NOT /_/*","/*"]}]}}

I noticed in my app Identifier in Developer Center (at certificates & profiles) when you press the identifier that you're working with on the top right there is an App ID Prefix stated. And for most (newer) apps that will be the same as the Team ID but sometimes it's different.

When it's different, in Firebase at the Team ID field you should enter the App ID Prefix!

After a while (took me 15 min or so) the apple-app-site-association will be changed and the new prefix will be shown. Again after some time my Firebase Dynamic Links started to work nicely.

Hope this helps some people that have the same problem and save them some time.

Tom Spee
  • 9,209
  • 5
  • 31
  • 49
1

I have tried out many things and found out that issue was resolved after adding below code in info.plist file.

<key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLName</key>
            <string>BUNDLE_ID_HERE</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>test</string>
            </array>
        </dict>
    </array>

Replace BUNDLE_ID_HERE with your iOS application bundle id and you can see the issue will get resolve and it will start taking to the app when clicking on dynamic link.

apurv thakkar
  • 8,608
  • 3
  • 14
  • 19
0

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>
Syed Waqas
  • 2,576
  • 4
  • 29
  • 36