Firebase dynamic link not opening the app iOS - ios

I have developed & installed an iOS app locally on my device.
And have set custom scheme in the info.plist as mydlink
Set associated domains as weel: applinks:<myapp>.app.goo.gl
Created dynamic link on firebase as:
https://<myapp>.app.goo.gl/?link=http://<mysite.com>/&ibi=<app bundle id>&ius=mydlink&ifl=https://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id%3D<app store id>%26mt%3D8&pt=<app store id>
When I open or click on dynamic link, it opens app page in the "App Store" app and not opening app itself though its installed.
What am I missing here?

sometimes we make a mistake in Associated Domains entitlements. There have to be no spaces
applinks:mydomain.page.link

If you are on iOS 9, universal links will be used. Universal links don't work in a lot of cases, like:
If you use a simulator
If you try to open the link directly in safari on a device (typing it into the address field in the browser)
I spent a lot of time trying this and could never get it to work on a simulator in a reliable way. What I end up doing is emailing the link to me and opening it from Inbox. Then it works every time!

I had an issue using iOS 14, running on device in debug mode.
Link has always redirected me to the AppStore app not to my app.
The solution was to enable "Associated Domains Development" on iPhone Settings>Developer>Associated Domains Development
(found it here: https://stackoverflow.com/a/63939770/6689321 ).

I'm sorry for the late reply - I hope your issue has been resolved and that this is helpful to others who may be experiencing the same problem.
There could actually be one or more issues here for iOS 9+; Dynamic Links relies on Apple's Universal Links to open the app on iOS 9+ and these suggestions are aimed at resolving issues with Universal Links and Firebase and have nothing to do with the SDK directly.
Verify that the assoc file is correct at https://app_id.app.goo.gl/apple-app-site-association - it should look similar to https://maps.app.goo.gl/apple-app-site-association but with only one element in "details."
As pointed out by another answer, verify that your team ID is properly set in the Firebase console.
If you've long-pressed the link and then clicked "Open in Safari" or you have clicked the "goo.gl>" button on the status bar of your app after the app opens via a Universal Link, then iOS defaults to opening Universal Links in Safari. This can be fixed by pulling down on the paged opened in Safari and clicking "Open in App" (or similar) on the smart banner.
The "ibi" parameter is not involved in opening the app in a post-install click on iOS 9+, but is in prior versions when the "ius" param is not set.
Regarding iOS 8, can you try running the app and then clicking a link after the app is installed? On versions prior to iOS 9, you can test by copy/pasting the link into safari.
https://firebase.google.com/docs/dynamic-links/ios

Just in case there is still someone out there having this issue, please note the following
Dynamic links now opens on simulator, please copy your link and paste on safari in your emulator.
Chrome and safari opens dynamic differently, safari uses only universal linking while chrome uses both url scheme and universal linking to open dynamic link. Ultimately you should try to get dynamic linking opening via universal link in your app.
If your dynamic link routes to App Store instead of opening your app. there is an issue with your universal link. You can temporarily test using chrome.
To set up opening dynamic link via universal link, please check the following
Ensure your Team id is correctly set In firebase console, get your team id from your membership detail in https://developer.apple.com
Ensure your domain is listed in your associated domain as shown below, no space between the domain
Ensure Associated domain is turned on in your apple developer account
if you are using a custom domain, ensure you add it to the info.plist as shown below.

I make a mistake that not setup Associated Domains for DEBUG, so make sure you setup Associated Domains all both DEBUG & RELEASE

I experienced same problem. Interestingly if you open the dynamic link in Chrome, app starts directly and successfully. But in Safari always it tries to open AppStore although the app is installed. I have no idea why Safari doesn't work in this case.

If none of the above workarounds work for you, please check if you have added activitycontinuation in associated domains or not.

Firebase dynamic links were not working for us (on iOS9 where they use universal links) due to a problem in Firebase's assumptions during setup. Here's how we fixed the problem on our app:
Firebase asks for your "Team ID" when adding your iOS app to Firebase Console Project Settings, and it assumes that your unique app ID will be in the format TeamID.com.foo.bar
However, in our case, that was NOT our unique app ID. When I looked at our provisioning profile (on developer.apple.com I found our provisioning profile and clicked "edit"), I saw that our unique app ID was actually SomethingElse.com.foo.bar
I had to go into Firebase Console and enter that "SomethingElse" in the spot where it asked for Team ID, even though that was NOT our team ID. Once I made that change, Firebase Dynamic Links started working correctly.
It appears Firebase is making an assumption that your unique app ID will always start with your Team ID, which is apparently not always the case.
Note that changing your Team ID can take a significant amount of time to take effect. You can see that the change has happened by checking the appropriate link for your app_id (https://app_id.app.goo.gl/apple-app-site-association).

After integrating Firebase Dynamic links, the sample link started working immediately on a device with iOS 8. For iOS 9 devices Universal links mechanism is used, as mentioned by other answers. This means Apple needs to update the entitlement data used to verify deep link dual authentication. This may take 48 hours, according to Apple's App Search API Validation Tool.
There are more Universal links troubleshooting tips here.

Experienced the same problem.
The solution for me was to use the
Identifiers -> App IDs -> 'my.app.ID' -> Prefix
You can find it on: https://developer.apple.com/account/ios/identifier/bundle
Instead of the 'DevelopmentTeam' number from the .pbxproj which I used and add it to the Team ID for my iOS app in the Firebase console.
And don't forget to download and add a new .plist to the project.

i had same issue with latest flutter sdk and firebase dynamic links plugin.
Tried all solutions the only fix was to manually insert com.apple.developer.associated-domains key to ios/Runner/Running.entitlements file
<key>com.apple.developer.associated-domains</key>
<array>
<string>applinks:abc.page.link</string>
</array>

I have great news.
I always hear that it's IMPOSSIBLE to test a dynamic link on simulator.
But now WE CAN test firebase dynamic link on simulator
https://stackoverflow.com/a/56385506/6273003

When link is open in safari, It shows a "open (project name)"button. If this button is pressed for 2-3 second, It asks for opening that into different apps for first time.It also shows your app name. If you select your app, It opens your app. After doing that if you again open this link and press button in safari, it always work fine.
This fixed the problem for me.

After completing the setup in Firebase and in the Xcode project.
Add below code inside SceneDelegate instead AppDelegate.
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
if let incomingURL = userActivity.webpageURL {
print("Incoming URL is \(incomingURL)")
let linkHandled = DynamicLinks.dynamicLinks().handleUniversalLink(incomingURL) { (dynamicLink, error) in
guard error == nil else{
print("Found an error! \(error!.localizedDescription)")
return
}
if let dynamicLink = dynamicLink {
self.handleIncomingDynamicLink(dynamicLink)
}
}
}

Set on your Xcode project the correct form to declare Associated Domain, you must to include applinks:

Make sure you have a Team Id set in the firebase console for you app. (you will then need to download and import the .plist file).
This fixed the problem for me.

We had a similar problem. The issue in our case was that the software that generated the emails with the links generated a new link that had a 304-redirect to our deep link. This did not work in Safari (but in Chrome).
Check that your deep link is actually the first link opened when you click the link in the email.

i had same case and it fixed with after defined ios app on deeplink url;
Dynamic Links -> choose your link -> Edit
make sure that you have defined ios app;

I had the problem, that the AASA file was different at the locations
[domain]/.well-known/apple-app-site-association
[domain]/apple-app-site-association
The validator from branch always checks the file on the non well known path. It was confusing because it always said it was all fine even though is was not.
For Firebase, check your hosting and search in the public dir for a .well-known folder. In my case, I could just delete it, run firebase deploy --only hosting and let Firebase generate all AASA files for me.
https://branch.io/resources/aasa-validator/

If you are sure all your dynamic links config in xcode is correct, link is good, but it still opens Appstore you can try this trick:
Copy the link and paste it into the notes app
Long press on the link in notes to see context menu
If you see button "Open in YourAppName" - try pressing it.

please check associated domains as well: applinks:.app.goo.gl is correct or not? and Dynamic link is easily work on iOS Simulater , I don't get any issues.

Related

Firebase dynamic link always goes to ios app store even if app installed

I have a dynamic link that is working fine on Android however I can't get the App Store redirect behaviour working correctly on iOS.
If I set up the dynamic link to go to a url (not the app store) if the app is not installed it works as expected and opens the app. This is the dynamic link:
https://go.xxxxx.app/?link=https://member.xxxxx.app&apn=app.xxxxx.xxxxx&isi=1573527302&ibi=app.xxxxx.xxxxx&ifl=https://member.xxxxx.app&efr=1
However if I set it to go to the app store if the app is not installed it ALWAYS goes to the app store, even if the app is installed.
https://go.xxxxx.app/?link=https://member.xxxxx.app&apn=app.xxxxx.xxxxx&isi=1573527302&ibi=app.xxxxx.xxxxx&efr=1
I am obviously doing something wrong or misunderstand the relationship between deep links and dynamic links. "go" is my dynamic link subdomain and "member" is my deep link subdomain.
I realise there are several other questions on this but none of the answers helped me.
Other info
I am using a physical iPhone 8 with iOS 15.4.1
This is my deeplink which works fine if I click the url on my device:
https://member.xxxxx.app
I have an app association file set up here:
https://member.xxxxx.app/.well-known/apple-app-site-association
I also set it here as I wasn't sure whether to set it up for the dynamic link as well:
https://go.xxxxx.app/.well-known/apple-app-site-association
I have the following Associated Domain set up in Xcode:
applinks:member.xxxxx.app
Note that I have not added the associated domain applinks:go.xxxxx.app as this just seemed to make the dynamic link be treated like a deeplink.
I have the capability associated domains turned on in my Apple Developer identifier.
My app is published to the app store but not the latest version of the app with the associated domain member.xxxxx.app.
I have added my app and team id to Firebase on the ios app.
I have "Associated Domains Development" turned on in the developer settings of my iPhone.
I added FirebaseDynamicLinksCustomDomains in my info.plist as mentioned here:
https://firebase.google.com/docs/dynamic-links/custom-domains#set_up_a_custom_domain_in_the
It appears I needed to add applinks:go.xxxxx.app to the Associated domains as well. I can't test from the App Store if the link parameter works I guess I will have to wait until I release to the store.
So the dynamic link is also a deep link that contains another deep link.
Kind of confusing. If anyone can add some more info or explanation that would be great.
I will leave the question here for now as it may help people.
I have the following Associated Domain set up in Xcode: applinks:member.xxxxx.app Note that I have not added the associated domain applinks:go.xxxxx.app as this just seemed to make the dynamic link be treated like a deeplink.
Edit:
To get the dynamic link working in iOS see my answer here:
Firebase short dynamic link not working in iOS (being treated as a deeplink)

Firebase Dynamic Links for iOS work for my device and simulators, but do not work for users after release

So I have implemented Firebase Dynamic Links in my app. I thought that I had them set up correctly, because they work for my own personal device and the simulators perfectly. I released the update to the app, but when two of my friends tried to open them after updating to the new version, it takes them to the Firebase website citing an error. I click the same link and it opens my app and handles the link.
Firebase has added the apple app site association to my domain prefix, I have added the a--link in my app's capabilities, I am truly at a loss as to why this may be. Even if they click the link from notes, it does not give them the option to open the link with my app like it will for me.
Is there anything that I could be overlooking? Happy to supply any relevant details but I feel like I have to be missing something.
App Links:
applinks:share.***.app
URL Type is set up in Target Info.
Custom Dynamic Domain is set in info.plist.
For others that come across this, it seems to be an open Apple bug: http://www.openradar.me/radar?id=4999496467480576
After several days, the user's apps downloaded the proper AASA and the deep links began to work. There doesn't seem to be a workaround with Google Dynamic Links, but Branch.io offers forced URI redirect mode to avoid this issue.

Firebase Universal links disabled and not working (iOS)

I am trying to get Firebase Dynamic links that I have integrated on my ios app to open. Following the youtube tutorial (https://www.youtube.com/watch?v=KLBjAg6HvG0) I have downloaded my app onto my phone from Xcode. When I try to open up the link I automatically get redirected into safari browser and I'm presented with this image.
https://imgur.com/a/e6AJMhj
The tutorial runs threw several things that could be the reason for my link not opening up my app
Make sure to have the correct URL in the Associated Domain Setting which I do. https://imgur.com/a/lJExtjU
Check and make sure that you have the correct App ID prefix entered in the console which is true because Xcode verifies that. https://imgur.com/a/LVytoni
Universal link for the domain was disabled because I opened it in Safari and I have to now long press on the link and open it in the app. Now heres the problem.
In mail app, imessages app, and notes app all dont have an option to "Open in .
Mail (https://imgur.com/a/Pz81IqN), iMessages (https://imgur.com/a/2ykChUM), and Notes app (https://imgur.com/a/lwoejEH).
Even referencing these guides I am unable to solve my problem (Universal Links iOS) (Universal Links not working on iOS10)
Check to make sure the apple-app-association file in created which it is and it shows that #2's image.
I have exhausted all options and googling for answers is now getting me nowhere. I need help on how to get my Universal Link working again.
It helps if applinks is not spelled "applink" in the Info.plist associated domains.

Firebase dynamic link always goes to app store URL even if the app is installed

I am trying to integrate Firebase dynamic link into IOS app but the problem is that even if the app is installed the dynamic link is taking me to app store page to download the App from app store.
Did anybody face the same problem and have solution for the same.
Edited the link through firebase console. With the 'Skip the app preview page' enabled and 'Use a custom scheme when universal links aren't supported' disabled I was always redirected to the app store.
The solution for me was to enable both universal links and a custom
scheme.
Can't say why, but maybe it will help someone.
After spending my whole one day, I am able to figure it out finally. It is working if your app is live, just set App ID & TeamID in Firebase App settings.
Issue comes up when app is not live and we are setting another App ID. Just add following line, it will work like a charm:
FirebaseApp.configure()
FirebaseOptions.defaultOptions()?.deepLinkURLScheme = Bundle.main.bundleIdentifier
Setting deepLinkURLScheme with your bundle id.
TL;DR: To make it work, you must also set up the Firebase Dynamic Link as a universal link in your app settings. To do so, see below.
My dynamic link worked with the preview page, but then I added "&efr=1" to skip the preview page and redirect directly to either the App Store or my app. It worked with the preview page because it called the universal link that was already set up with the app.
Example: My app is named Spontit. Preview page worked because the "Open" button redirected to spontit.com, which is linked to my app. But the dynamic link is spontit.page.link - a different domain name - and therefore, if you skip the preview page, it opens spontit.page.link and not spontit.com in Safari and so not my app, and subsequently redirected to the App Store always.
You must set up the custom dynamic link (e.g. spontit.page.link) as a universal link. Follow these steps to do so.
Source: https://firebase.google.com/docs/dynamic-links/ios/receive
I faced the exact same problem.
To work around this, I give up href attribute and use onclick on <a/>
<a onclick="location.href=https://somedynamiclink.url">Dynamic Link</a>
Please note, no href attribute on a tag.

Firebase iOS is not opening my app from Safari

I tested the dynamic links Firebase. Configured everything in the project, the implementation did exactly like the Google documentation and created links on the console. When I test in Safari it does not open the application.
Thank you
iOS 9+
Due to the limitations on the iOS platform, Firebase Dynamic Links must rely on Apple's Universal Link system to open the app directly from a link when it is installed. One of the constraints placed on Universal Links is that the app-open behavior is only triggered from a user's click and not by a redirect or copy/paste into Safari.
We have found it very challenging to test Universal Links in the simulator and pretty much always use a real device for this type of thing. Basic steps: install app > SMS link to your test device > click link > observe app open.
iOS 8 and prior
iOS versions prior to 9 handle opening the app from a Dynamic Link through Safari, so if the app is not opening when you copy/paste the link into Safari then some setup is incomplete. Please review your Firebase project for information and confirm that your bundle IDs/custom schemes match on the project page, in your link, and in your app; be sure that the bundle ID is listed in URL Types in your Xcode project setup along with any custom scheme you wish to use.
Other Info
Here is a link to a prior answer that may be helpful as well.
Firebase dynamic link not opening the app iOS

Resources