-
Notifications
You must be signed in to change notification settings - Fork 4k
🐛 [firebase_dynamic_links] iOS getInitialLink() is null, onLink not called #6913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @choi-seung-min |
Hello @markusaksli-nc note launch url through safari but i changed to open my app directly(long press and select open myapp). |
So the issue is present if the app is launched when opening the link in safari or in all cases? |
|
When I open link with note(long press the link and select open link in myapp), |
updateOn iOS when i copy and paste generated dynamic link to safari, it shows my app icon and open button. If i click open button, safari show error message |
I still haven't been able to reproduce this. It works as expected on both simulator and physical. Could you provide a minimal complete reproducible code sample? |
As I followed document of If it's not result of url scheme, please check if I forgot something to do for iOS setting.
Additionally, I figured some kind of work around with But this cause exception with dynamic route with flutter. |
If you set up the URL Type correctly
then you should have done everything necessary for the links to work. The reason I asked for a minimal complete sample is to exclude any other plugins to see if it reproduces on its own and to see if you are calling the listeners correctly. Could you also provide your |
I'm little confused. as you said
I have different bundle id with iOS and Android. And my Dynamic link is based on android's bundle id. My
|
Your podfile looks fine. What do you mean by your dynamic link being based on the android bundle id? If you mean that is the bundle id you specified when you generated it then this might just be solved if you generate a dynamic link with the Apple bundle id? This is why you are presented with the option to specify the bundle id when you generate the dynamic link. The bundle id plays a role in how the generated link is used by the target platform. |
I suggested that the iOS tag be removed from the pubdev page of dynamic links as it is misleading. As a workaround, on iOS we use app_links and parsed the short url that comes in. So we embedded parameters in that to parse and execute code accordingly. It's not the best solution but a patchy work-around if you are against the clock |
Hey folks, dynamic links API has changed quite a bit since the major version update which you can see in the changelog here. I have tested on my device (iOS 14) and |
I've tested in iOS simulator and it's working as expected! Update: Working as expected in physical iOS device as well. |
I couldn't make it work even with the I'm still using a mix of I've also added the |
@russellwheatley @ggirotto yes the new update works fine for when the app is already installed on phone. However, it still fails for production apps i.e. apps on the AppStore. For whatever reason, when the user is redirected to the appstore to install the app, after install the link is no longer detected by |
@russellwheatley I have tested this on physical iPhone 12 Pro, iOS 15.0.2 and I couldn't get a link from Using 4.0.3
@ggirotto you said that
? |
Good catch. unfortunately my Mac is under repair. As soon as I get it back I add my points to this thread. |
Now that my app finally is in production, I can say that the feature is working as expected to me. The deep links are correctly being opened and their metadata is being injected in the UI (in my case, I'm using to share referral codes in deep-links) |
@ggirotto, thanks for the report. @kightsonsanom, have you tried adding this property to your Info.plist file? Be sure to change the domain to the one you're using for your dynamic link. Let me know how it goes. |
@russellwheatley We added this property to the plist pointing to our custom domain, and it's working as expected. I'm not sure what others are facing when they find errors during the usage, but for me the plugin is working as expected. |
Same thing as @kightsonsanom. I'm practicaly copied example and it's not working. Any updates? |
I am experiencing a similar problem on iOS clicking a dynamic link when the app is not running. Works fine on Android. I believe whats happening is that getInitialLink() is returning null, but then 'X' number of milliseconds later onLink.listen() fires with the link information, which creates a race condition. Adding a one second wait right before the call to getInitialLink appears to be a viable workaround.
I am using firebase_dynamic_links: 4.0.6 [✓] Flutter (Channel stable, 2.10.0, on macOS 12.1 21C52 darwin-x64, locale en-US) |
But assuming that the |
Perhaps I'm doing something incorrectly then. If getInitialLink returns null, I navigate to what is essential a home screen. If either get initiallink, or listem return data, I navigate to a "special" screen that displays the link content. What seems to be happening in this:
Ultimately, when the app is not running the dynamic link correctly starts the app and the link screen loads. But then a second or two later, it is automatically replaced by the default home screen. |
@russellwheatley thanks for the input. I do have custom domain setup and I was missing |
Hey @choi-seung-min. 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! |
Since there haven't been any recent updates here, I am going to close this issue. @choi-seung-min if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this. |
many thanks to #6913 (comment) for a working workaround to this annoying problem which totally still persists. |
I also wasted two entire days figuring things to work and I want to share with you what fixes the issue. Although the #6913 (comment) workaround actually works (as of now you need to slightly change the code because of new version of app_link library), you can avoid to use app_link library with the following steps:
this is my situation for the iOS key: Now the At the end it seems the application cannot successfully resolve the link because of an unauthorized call against FirebaseService. Hope this helps. |
My APi key is not restricted , but still not getting the onLink callback |
Bug report
getInitialLink() is null, onLink is not colled on iOS
On Android, both getInitialLink() and onLink called successfully. I can get deep link through those methods.
But on iOS, app does launch with dynamic link but getInitailLink() is null and onLink is not called when app is in background.
Steps to reproduce
Basically, I followed docs from pub.dev https://pub.dev/packages/firebase_dynamic_links.
I generated url prefix with google generated
myapp.page.link
.Added Associated Domains
applinks:myapp.page.link
.Added Url Types Identifier:
Bundle ID
, URL Schemecom.example.myapp
.Generating Dynamic Link:
Receiving Dynamic Link:
When i open app through dynamic link with safari, I got these errors.
Additional context
My Flutter app's android bundle ID and iOS bundle ID is different.
As there's duplicate ID in appStore, I changed to ex) myapp -> myappios
Flutter doctor
Run
flutter doctor
and paste the output below:Click To Expand
Flutter dependencies
Run
flutter pub deps -- --style=compact
and paste the output below:Click To Expand
The text was updated successfully, but these errors were encountered: