Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDynamic links on IOS not working #3450
Comments
|
I'm having the same issue, in addition, I'm not using a custom domain and in android works correctly. |
|
+1. To work around this issue I'm using Linking package from RN:
|
|
@TalEliel @MarcoF09 @ahanusek I spent a day looking for those without luck. And it seems what needs to be added to I appreciate in advance if you guys could point me to some documentation about that. |
|
I'm in the same boat, why do the v6 docs not cover the necessary configurations for RNFB Dynamic Links in the Here's a snippet of what I found, but it only sometimes works: AppDelegate.m - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [RCTLinkingManager application:application openURL:url
sourceApplication:sourceApplication annotation:annotation];
}
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
options:(NSDictionary<NSString *, id> *)options {
return [[RNFBDynamicLinksAppDelegateInterceptor sharedInstance] application:application openURL:url options:options];
}
- (BOOL)application:(UIApplication *)application
continueUserActivity:(NSUserActivity *)userActivity
restorationHandler:(void (^)(NSArray *))restorationHandler {
return [[RNFBDynamicLinksAppDelegateInterceptor sharedInstance] application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
}I try to handle a login link for useEffect(() => {
return dynamicLinks().onLink(async link => {
if (auth().isSignInWithEmailLink(link.url)) {
if (!email) {
// TODO: If no email, have user input
return
}
try {
await auth().signInWithEmailLink(email, link.url)
} catch (e) {
console.error(e)
}
} else {
// Not a dynamic link for auth, handle with router
}
})
}, [email])The issue this only sometimes gets triggered. I can't figure out why, maybe it's a dev only thing, but it's frustrating that the docs don't clearly say what the setup ought to be so I can troubleshoot just my code instead |
|
PRs always welcome, the docs all have an edit button at top right |
|
@russellwheatley only a comment, in my case occurs also in version 5.6.0. |
|
I am having the same issue, someone can address this issue? |
|
Hey @TalEliel, could you please confirm that you have actually added a URL type? Effectively, you need to add your Bundle ID to the If I did not set this, then the returned object from the |
|
Hey @russellwheatley , yes i did add a utl type with the bundle identifie. |
|
Interesting. I created a fresh RN project, the only code I added to my Do you mind if I see your |
|
@russellwheatley sure. this is the file. |
|
do you mind pasting that into the comment box, please? |
|
|
Hmmm, there is nothing out of the ordinary with your |
|
I'm also having problems with Dynamic Links on iOS. Both
Not sure if this is related? I see a similar report in firebase-ios-sdk |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
The same issue with me. Is there any update for this? |
|
same problem. |
|
Same issue. I was able to see the link with using React Native's Linking module, however it only interprets shortened URL's via the "Open link in app?" interstitial. Clicking the link from my Messages app outputs only the already shortened URL. Also seeing this issue here, could it be related? |
|
I had the same issue initially.
|
|
Hey @bobinrinder |
|
So
|
|
I'm seeing this behavior on my app as well. Any additional context that would be helpful? |
|
My issues appeared to be related to using a custom domain and needing to set EDIT: Scratch that... it was working in my Debug build but doesn't work on a cold app-start in my release version |
BackgroundI'm experiencing this issue too. Specifically, the Dynamic Link from a "passwordless email authentication" email, when clicked in Apple Mail, has failed to open my app, and has instead opened iOS Safari. This has been the case for 3 out of my 8 testers, which is a really awful failure rate. They're all on iOS 13. @russellwheatley Could I please have a basic sanity check of whether my I've following the latest Dynamic Links documentation for React Native Firebase (which, incidentally, have greatly improved in the last weeks – thank you!). It doesn't mention anything about how we should set up Firebase Dynamic Links for iOS official docsFor reference (please nobody copy this without reading on), in Google's Firebase Dynamic Links docs for iOS, they show the following: - (BOOL)application:(UIApplication *)app
openURL:(NSURL *)url
options:(NSDictionary<NSString *, id> *)options {
return [self application:app
openURL:url
sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
annotation:options[UIApplicationOpenURLOptionsAnnotationKey]];
}
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication
annotation:(id)annotation {
FIRDynamicLink *dynamicLink = [[FIRDynamicLinks dynamicLinks] dynamicLinkFromCustomSchemeURL:url];
if (dynamicLink) {
if (dynamicLink.url) {
// Handle the deep link. For example, show the deep-linked content,
// apply a promotional offer to the user's account or show customized onboarding view.
// ...
} else {
// Dynamic link has empty deep link. This situation will happens if
// Firebase Dynamic Links iOS SDK tried to retrieve pending dynamic link,
// but pending link is not available for this device/App combination.
// At this point you may display default onboarding view.
}
return YES;
}
return NO;
}React Native Dynamic LinksI notice that in React Native Firebase, however, some magic is going on. The library implements RNFBDynamicLinksAppDelegateInterceptor, which swizzles the app's AppDelegate. I have no clue exactly what the swizzling is doing behind the scenes, and it would be great if it were documented! My own codeMy guess from debugging, though, is that Nonetheless, I've put a guard in to make sure that my app (which also handles URLs passed to it from an Action Extension) doesn't accidentally handle a URL that has already been handled. Could you please clarify whether this guard is redundant @russellwheatley.
|
@ahanusek Do the Dynamic links work for iOS in all cases when you use Linking, where they'd been failing before by using React Native Firebase Dynamic Links? |
|
Has anyone faced the issues when it says:
The whole error:
|
|
@alex-mironov if I recall correctly someone mentioned it in another issue and it was their project setup was incomplete. #3755 (comment) |
|
@mikehardy thanks, from what I can tell setup is fine, the link is opened. The problem I'm seeing, is that this failure on start increases startup time significantly. I'm trying to find a way to postpone deeplinks initialization, but it seems to be native part, which I cannot influence much from the JS... Here is related issue btw firebase/firebase-ios-sdk#5032 |
|
How unfortunate. A quick read of that issue (thanks for the link!) shows this as prior art: googleapis/google-api-dotnet-client#1186 (comment) and indicating that the hostname is either misconfigured or as a recent PR indicates, they need to handle it better In the meantime, there is nothing as nifty that I have seen as patch-package for cocoapods, but I wonder if you could hand-hack https://github.com/firebase/firebase-ios-sdk/blob/master/FirebaseDynamicLinks/Sources/FIRDynamicLinkNetworking.m#L36 to be v4 in both cases if it would work |
|
So after reading the entire thread we're still nowhere near to understanding what configuration is actually required for |
|
Hitting this issue also on iOS. Followed the guide here https://rnfirebase.io/dynamic-links/usage#listening-for-dynamic-links. App opens correctly when clicking on the dynamic link but |
|
Oh apologies, it seems like its actually an issue with the firebase sdk itself (as mentioned by others above). firebase/firebase-ios-sdk#5032 Check Xcode and I'm getting the same error:
|
|
@mrbrentkelly reach right into that cocoapod and hack out the ipv6 thing. I bet it works for you. If it does, then I would write a tiny idempotent change in ruby in your podfile as a post_install hook https://guides.cocoapods.org/syntax/podfile.html#post_install That hook should take the patch you generate from running patch after making your change, and should attempt to apply it (a la the javascript-level patch-package) You'll have reproducibly applied your change then and you can maybe move forward until the upstream issue is resolved There are many in this position, any report you had of success with this style would probably be met with a lot of thanks |
|
Thanks @mikehardy |
|
Ok I've managed to get this working by simply adding Works on Debug and Release builds thankfully. https://firebase.google.com/docs/dynamic-links/ios/receive#open-dynamic-links-in-your-app
Note, I'm still seeing the |
|
@mrbrentkelly I had a similar experience to you where adding the plist key/value let my links staart working as expected. However I quickly realized that the flow was pretty flaky. I would say I had about 50/50 success/failure when using the link through an app install |
|
I fixed with this simple line in the And my final code with Firebase Dynamic Links + React Native Linking:
Versions:
|
|
@RodolfoGS something went wrong with AppDelegate swizzling for you, that should not be necessary and is not documented because it is not supposed to be necessary: |
|
Haven't had problems with current lib version, except with Detox e2e tests using I thought |
|
I was getting very inconsistent results when I set up the onLink listener before calling getInitialLink. Sometimes it would trigger the listener first and getInitialLink would be null. YMMV. |
|
Now considering just using the standard React Native Linking lib with |
|
Hey guys, I really don't know if it matters or not but have you tried setting
ps. I'm using v5.6.0 |
|
from google docs you need to add that FirebaseDynamicLinksCustomDomains in info.plist .
https://firebase.google.com/docs/dynamic-links/custom-domains#using_your_web_domain_for |




Issue
Describe your issue here
Hey, I have been trying to use dynamic links in my app and ran into an issue on IOS where the dynamicLinks().getInitialLink() always returns null and the dynamicLinks().onLink() is not called upon entering the app from dynamic link
Project Files
Javascript
Click To Expand
package.json:firebase.jsonfor react-native-firebase v6:iOS
Click To Expand
ios/Podfile:AppDelegate.m:Android
Click To Expand
Have you converted to AndroidX?
android/gradle.settingsjetifier=truefor Android compatibility?jetifierfor react-native compatibility?android/build.gradle:// N/Aandroid/app/build.gradle:// N/Aandroid/settings.gradle:// N/AMainApplication.java:// N/AAndroidManifest.xml:<!-- N/A -->Environment
Click To Expand
react-native infooutput:react-native-firebaseversion you're using that has this issue:Firebasemodule(s) you're using that has the issue:TypeScript?React Native FirebaseandInvertaseon Twitter for updates on the library.