Closed kalyani6474 closed 2 years ago
@kalyani6474
Does it work on Android ?
Can you provide flutter doctor -v
and a complete minimal reproducible code sample that shows the issue ?
Yes It works on Android.
It works on IOS also. but first we need to remove app from background [everytime]. then it works in IOS.
@kalyani6474 If I understand the behavior correctly, when you click on the link and app is in background, the app doesn't open, but if you click the link when app is closed or in foreground, it works properly ?
In the app background scenario, does it throw any error ? like, is data comes back with null or do you see any other log ?
As requested earlier, please provide flutter doctor -v
and minimal code sample that shows this issue.
when i click on the link and app is in background, the app will open, but not get deeplink and its data. when i removed app from background, then click on link, app will open and get deeplink and its data too.
In the app background scenario, No error. After closing app doesn't show any logs.
As requested earlier, please provide
flutter doctor -v
and minimal code sample that shows this issue.
May be similar / related to https://github.com/FirebaseExtended/flutterfire/issues/4716
Hey @kalyani6474. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
Hello, i might have the same issue. I use the code below. My flutter doctor -v shows no issues. Everything runs properly on Android. With iOS, I have found the following behaviour, but only on a few devices:
Scenario 1: The App launch is created via opening a link. Which seems to result in an expected behaviour. The Link gets called and is addressed properly via await FirebaseDynamicLinks.instance.getInitialLink();
Scenario 2: The App is in a paused state (not viewable, receives no user input, runs in background). After clicking the link the app is resumed and brought to foreground, user input can now be received. Usually this is where the callback FirebaseDynamicLinks.instance.onLink
should be called. But my breakpoints and prints inside in both callbacks, onSuccess
and onError
never get executed. It seems that the callback method is not working properly.
In summary, I think that the callback is not registered on some iOS devices or on some iOS Versions. For now, I can not tell which devices or versions are affected. I am going to reproduce the issue in a Hello-World-App and post my results in a few days.
I am experiencing similar behavior. On a physical device, in debug mode, for a firebase auth email link, i get the following errors, but it does not register an onLink. In the past it would. I'll create a full issue as best I can in a separate submission if needed. Just don't have the time to figure out how to create a reproduceable project, which is where these bugs go to thrive when you have the wrong person monitoring.
8.0.0 - [Firebase/Analytics][I-ACS023001] Deep Link does not contain valid required params. URL params: { amv = 12; apn = "com.myapp.myapp"; ibi = "com.myapp.myapp"; ifl = "https://myapp.firebaseapp.com/__/auth/action?apiKey=1234&mode=signIn&oobCode=1234&continueUrl=https://mysite.com&lang=en"; link = "https:/myapp.firebaseapp.com/__/auth/action?apiKey=1234&mode=signIn&oobCode=1234&continueUrl=https://mysite.com&lang=en"; } *****NOTE ABOVE: only one / ...this is not a typo. A "/" seems to be missing, and might be the issue.
FLTFirebaseDynamicLinks: Unknown error occurred when attempting to handle a universal link: Error Domain=com.firebase.dynamicLinks Code=500 "(null)" UserInfo={message=Internal error encountered., status=INTERNAL, code=500}
After migrating to version with null safety, I started to experience this behavior.
Hi! I have problems with dynamic link on IOS 14.4.2 when i click on the link and app is in background, the app will open, but not get deeplink and its data. when i removed app from background, then click on link, app will open, but not get deeplink and its data too. In logs XCode i saw 2021-06-11 12:16:48.031694+0300 Runner[1518:170517] [connection] nw_read_request_report [C1] Receive failed with error "Software caused connection abort". XCode 12.4 and build version 12D4E. I try to find how fix it, but i couldn't.I need help. On Android all work correct.
Hey @kalyani6474. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
adding await Future.delayed(Duration.zero)
worked for me when ios app is in background.
app link - https://apps.apple.com/us/app/gist-tech-news-in-100-words/id1559849614
@vemarav Hello, where exactly did you add this line?
@aguenter
await Future.delayed(Duration.zero);
var data = await FirebaseDynamicLinks.instance.getInitialLink();
var deepLink = data?.link;
and
FirebaseDynamicLinks.instance.onLink(onSuccess: (dynamicLink) async {
await Future.delayed(Duration.zero)
var deepLink = dynamicLink?.link;
final path = deepLink?.path;
navigateOnDynamicLink(path);
}, onError: (e) async {
debugPrint('DynamicLinks onError $e');
})
setup google meet at vemaravv@gmail.com if it's still not working
Hey @kalyani6474. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
still not working on iOS,
Adding await Future.delayed(Duration.zero);
not working too
Hey @kalyani6474. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
I've been trying to get to the bottom of this problem and I think I may have come across something that is a problem at least in my app/setup. I'm not sure if this is exactly the same problem as this issue or if it should be a separate issue, but I'll share my findings
My setup was working to the extent that the email is being sent out with the correct custom domain, and when I click the link in the email app on the device the app opens, but the onLink
listener is never triggered. I started suspecting the FirebaseDynamicLinks
pod was the culprit and after a lot of breakpoints I finally found something that doesn't look right
Inside the FIRDLIsURLForAllowedCustomDomain
method in FDLUtilities
this check is being done urlStr.length > domainURIPrefixStr.length + 1 && ([urlStr characterAtIndex:domainURIPrefixStr.length] == '/')
At first this looked legit, until I noticed that the /
that is being looked for in urlStr
is not actually there, and a ?
is found instead, meaning that customDomainMatchFound
will be false
Looking at the link found in the email, the /
is where it should be, so somewhere along the way this character seems to be intentionally removed from the link making this if-statement fail
Why and where this happens I haven't been able to find out yet, but maybe it can point someone else in the right direction for a proper solution
I've been trying to get to the bottom of this problem and I think I may have come across something that is a problem at least in my app/setup. I'm not sure if this is exactly the same problem as this issue or if it should be a separate issue, but I'll share my findings
My setup was working to the extent that the email is being sent out with the correct custom domain, and when I click the link in the email app on the device the app opens, but the
onLink
listener is never triggered. I started suspecting theFirebaseDynamicLinks
pod was the culprit and after a lot of breakpoints I finally found something that doesn't look rightInside the
FIRDLIsURLForAllowedCustomDomain
method inFDLUtilities
this check is being doneurlStr.length > domainURIPrefixStr.length + 1 && ([urlStr characterAtIndex:domainURIPrefixStr.length] == '/')
At first this looked legit, until I noticed that the
/
that is being looked for inurlStr
is not actually there, and a?
is found instead, meaning thatcustomDomainMatchFound
will befalse
Looking at the link found in the email, the
/
is where it should be, so somewhere along the way this character seems to be intentionally removed from the link making this if-statement failWhy and where this happens I haven't been able to find out yet, but maybe it can point someone else in the right direction for a proper solution
Agree. The missing / is what I observed to be the issue.
@darshankawar could the blocked: customer response
label be removed from this issue so that it could get some more attention, or would it be better if either of us opens a new issue? I feel like the findings from @jbryanh and myself could be where the problem lies
Hey @kalyani6474. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.
If you have more information that will help us get to the bottom of this, just add a comment!
This issue is not stale 😅
I'll label this for now based on the number of reports and attempt to reproduce the issue but for those of you facing this could you specify how exactly you are opening the link?
I wasn't able to reproduce the issue on the latest firebase_dynamic_links: ^2.0.7
. The link opens with the appropriate data when the app is backgrounded or terminated when opening with the Open in appname context menu option on iOS.
I just realized that nowhere above I forgot to mention that this issue I am having is specifically related to the email signing using Firebase Auth which seems to be the same issue that @jbryanh is having, but might not correspond fully to the problem of the original issue
When putting a breakpoint in the FIRDLIsURLForAllowedCustomDomain
method in FDLUtilities
the value of urlStr
is something like this (broken up for legibility)
URL NSURL * @"https://dynamic-link.myapp.com
?link=https://myapp.firebaseapp.com/__/auth/action?apiKey%3D...%26mode%3DsignIn%26oobCode%...%26continueUrl%3Dhttps://dynamic-link.myapp.com/sign-in%26lang%3Den
&apn=com.myapp
&amv
&afl=https://myapp.firebaseapp.com/__/auth/action?apiKey%3D...%26mode%3DsignIn%26oobCode%3D...%26continueUrl%3Dhttps://dynamic-link.myapp.com/sign-in%26lang%3Den
&ibi=com.myapp&ifl=https://myapp.firebaseapp.com/__/auth/action?apiKey%3D...%26mode%3DsignIn%26oobCode%3D...%26continueUrl%3Dhttps://dynamic-link.myapp.com/sign-in%26lang%3Den"
This makes the check [urlStr characterAtIndex:domainURIPrefixStr.length]
fail as it will not find the expected /
after the .com
but the ?
Looking at the link in my email the /
is there, so something along the way is removing it
I still didn't manage to figure out where this URL is coming from or even how to debug this further, but if anyone can point me in the right direction I'd also be happy to investigate it myself
I'm also facing this kind of error. Despite of following every step on plugin Docs, when using Firabase auth for signin a user with the Dynamic Link .sendSignInLinkToEmail(), on IOS it always display the error:
Deep Link does not contain valid required params. URL params: {...}
This goes after opening the link received on email. The app is opened, but reading the link data fails with this error. This only occurs in IOS, Android is working as expected.
Everything on flutter doctor is correct. Tested with plugin version 2.0.9
Same issue on IOS 12 with latest firebase plugins. It is happening while opening a dynamic link generated by firebase auth.
Same issue on iOS 14.6, firebase_dynamic_links: 2.0.9. Works fine on Android.
When app is in the background, deeplink opens the app but the FirebaseDynamicLinks.instance.onLink
never tiggers.
What helped me was always calling FirebaseDynamicLinks.instance.getInitialLink()
at the start of the app. After calling this, my FirebaseDynamicLinks.instance.onLink
works properly.
@MyisCARRY , could you please an example of how you implemented this?
I'm running FirebaseDynamicLinks.instance.getInitialLink()
on main.dart before calling runApp(MyApp());
and it stills doesn't work.
@felipemy
void main() async {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
State<StatefulWidget> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
FirebaseDynamicLinks.instance.getInitialLink();
FirebaseDynamicLinks.instance.onLink(...);
super.initState();
}
@override
Widget build(BuildContext context) {
return ...;
}
}
@MyisCARRY, thanks for sharing!
I tried implementing this way and it worked only when the app is first launched. If another link is sent again afterwards, the error is thrown again.
Also tested by calling in WidgetsBinding.instance.addPostFrameCallback()
, didChangeDependencies()
and even at didChangeAppLifecycleState(if resumed)
, but the error persists.
The only way to get the link working again is by killing the app and run all again (or hot restart). So in my case doesn't solve yet.
I am still not having any success with this after a couple of months when it comes to catching the login link from the email sign in, what am I doing wrong?
Would love to have some feedback on the two previous posts I made on this thread as well if possible, I still believe that is the culprit
@markusaksli-nc when you said you couldn't reproduce it, was this just with a dynamic link, or using the firebase_auth
email signin link? If they are being treated as the same story maybe it would be better to open https://github.com/FirebaseExtended/flutterfire/issues/6805 again since ut is specifically related to the dynamic_links
+ auth
combo
Got same issue but resolved with adding this following key on Info.plist
<key>FirebaseDynamicLinksCustomDomains</key>
<array>
<string>https://example.com/link</string>
<string>https://example.com/promos</string>
</array>
Source: https://firebase.google.com/docs/dynamic-links/custom-domains
Hope it helps.
I am also facing the same issue. One extra observation which I found and thought will be helpful for others . I have an onboarding screen where I show users some introduction and then they go to Homepage. If I open my app normally (without calling getInitLink ) and go through intro screen (which also register for onLink), the dynamic link is able to trigger callback for onLink. However when I go all the way to homepage and do same, onLink never got triggerred . Also, this only works in iPhone and in Android, no matter what I do , onLink is not fired if the App is in background/foreground. Is this something to do with Crashlytics widget ?
I have finally resolved my issue and this will definitely help someone here. In my routine where I was setting up dynamic links handling , I had the call to FirebaseDynamicLinks.instance.getInitialLink() "before" the call to FirebaseDynamicLinks.instance.onLink.listen((dynamicLinkData) .... This apparently was causing the issue and when App was launching normally, the second call was blocked because getInitialLink was returning null and function was exiting (most likely due to Nullsafty error of using null check operator on Null ) , but App was not crashing somehow as this code runs asynchronously.
Once I flipped the order and call onLink first , it starts to work as expected . In my case , iPhone was working even with old order and that might be due to some OS related feature which I don't know.
Hopefully this will help someone here.
I still can't solve this problem. I'm using ver.4.1.2, and example code.
But it does't work when app opened from dynamicLinks web page. (works fine when App is running and Android.)
many thanks to https://github.com/firebase/flutterfire/issues/6913#issuecomment-969214337 for a working workaround to this annoying problem which totally still persists.
https://github.com/firebase/flutterfire/issues/6913#issuecomment-1084441844
this helps me to resolve the problem: https://github.com/firebase/flutterfire/issues/6913#issuecomment-1094101508
if you using ios, Custom domain long url and with version > 2.0.9, is that was bug. https://github.com/firebase/firebase-ios-sdk/commit/c1a33a099d36438de35d381b579185e26d6391d9 https://github.com/firebase/firebase-ios-sdk/pull/9516 it will fix to next dynamic link 8.15.0 update.
Hey @kalyani6474, I've just tested this on the firebase_dynamic_links example app and it works from background and terminated state. If you wish to test a working demonstration yourself, please follow the instructions here. Thanks.
Same issue on iOS 14.6, firebase_dynamic_links: 2.0.9. Works fine on Android. When app is in the background, deeplink opens the app but the
FirebaseDynamicLinks.instance.onLink
never tiggers.
I'm having exactly the same issue here, the workaround was to use the app_links library instead
Why dynamic link is not working on ios device when app is in running/background state? and i observed when app is removed from background then it is working fine according to expectation.