问题
I have implemented the function for generating Firebase iOS dynamic link with only my deep link, bundle id and app store id (using Whatsapp as testing case) in my server.
I can trigger the redirection when the app is installed (reading the deep link). However, deep link is always used for redirection when the app is not yet installed. Thus the app store ID is never triggered. Is there any possible reason behind?
回答1:
Couple ideas that may help debug the case.
Behavior of the Firebase Dynamic Links may slightly differs depending in which iOS App the link is being tapped. As a baseline, I suggest by starting from posting link to iOS Notes App and tapping on the link from Notes App. When this case works, you can move to test link in other Apps, like Safari, Facebook, WhatsApp etc.
If the iOS App is not installed, Firebase Dynamic Link (in your case) should navigate to iOS AppStore. Can you post here short or long dynamic link you are have issues with? Alternatively feel free to open Firebase support bug or email myself at oleksiyi at google.com .
Another technique you can try: append &d=1
to the end of your link and open the link in browser. You will see debug page with link expected behavior.
As an alternative approach, you can specify fallbackURL
from FIRDynamicLinkIOSParameters (here example https://firebase.google.com/docs/dynamic-links/ios/create and here docs https://firebase.google.com/docs/reference/ios/firebasedynamiclinks/api/reference/Classes/FIRDynamicLinkIOSParameters) at link creation time. In this case link should navigate to this URL when the iOS App is not installed.
EDIT (after syncing by email here is summary): Reason is that AppStoreID in the dynamic link should match the AppStoreId for your App that you entered in Firebase Console for your project.
Fix #1: I understand that your App is not released. Still you can get the AppStore ID before App is released from your iTunesConnect portal. Also see this comment about AppleID (that is the same as AppStore ID) for the App https://stackoverflow.com/a/12764735/2546685
When you create such link, the link will go to AppStore but it will not open page with your App until your is actually released.
Fix #2: If you want for link to work correctly before App is released you can follow such steps:
- create on your own website landing page, where will be presented content like: “App XYZ is not available yet”
- specify this landing page URL as “ifl” parameter in dynamic link;
- create the dynamic link;
- share link with people;
- when your App is actually released in AppStore, edit landing page, and instead of displaying content here, do server redirect to AppStore page of your App.
来源:https://stackoverflow.com/questions/45680893/error-when-handling-ios-dynamic-link-for-firebase