flutter-branch-io
flutter-branch-io copied to clipboard
In Android Not get deeplink data on First Launch
same problem here, when the app is closed the listenToOnStartStream returns an empty callback.
please take a look at @ovidiu-anghelina's comment here.
I'm also still trying to debug this behavior, because in my case it works even when the application isn't on background before. I also tried making setupBranchIo
function an async function with no luck.
@blackmenthor Hey thanks for the plugin! Just to clarify, are you also running into the issue where branch is only initialized on resume?
This plugin is awesome, but I have tried the workaround here, and it's useless. Still can't get the deep link when app cold starts. Is there any further progress?
@blaizechuang Are you using a LauncherActivity
for your flutter app?
@danybuoy Yes, I did it. And I also tried to test your sample code with my branch key as the following steps:
- Migrate sample project to support Android X
- Update branch key and the scheme the same with my project
- Install the sample app and force close it
When I triggered the deeplink from my web site, the sample app launched but there was no deep link info on the screen. And when I triggered the deeplink again, the sample app showed the correct deeplink.
@blaizechuang I'm getting the same issue too, I noticed that on first startup Branch.getInstance().initSession()
never completes and therefore doesn't handle the link. Do you now if theres a way to get more verbose logging for branchsdk?
@danybuoy It seems that enableDebugMode can get all the log and you already enable it. I will update here if there are any findings.
Hey guys I've got some good news, I've Identified the problem and I've got a small workaround that I'm planning to further refine and include in this repo. I'm able to get branchIO links on startup now as well as generate branch links without having to background the app first.
The issue seems to be that branchIO is quite specific as to when it wants to be initialized. If you refer to the documentation provided by branch, it specifies that branch must be initialized in the onCreate
of your applications class.
After adding the branch dependency to my projects build.gradle
, creating an Application.kt
class and registering it in the manifest (as an application) - the plugin works like a charm! I'll be further developing this workaround, so expect a PR from me in the coming weeks ;)
Note: This is for android only
Any updates on this?
having the same problem
bump
Hi @bejavu I was having the same problem and I built a plugin to use in my projects. If you want to check: https://pub.dev/packages/flutter_branch_sdk