I'm using app links with uni_links library in my flutter app.
There is a problem that whenever I clicked my app link in another application(like Google Calendar), the OS opens my app again.
Somehow I have a duplicate of that. Here is my screenshot that what exactly happened:
I just want to open my last app that exists in background.
What should I do to fix this problem?
You can use flutter_appavailability package. This plugin allows you to check if an app is installed in mobile and using this plugin you can launch an app. If already installed then launch otherwise open link in WebView using url_launcher.
For opening apps in android For opening an external app from your app in android, you need provide packageName of the app. If the plugin finds the app in the device, it will be be launched. But if the the app is not installed in the device then it leads the user to playstore link of the app.
Yes, and I override the didChangeAppLifecycleState method. And in that you cleared the state or navigated to another screen? Well, now I know that you are not the only one facing this issue. And the android docs say that for this functionality resort to native code as much as possible.
Well according to this answer,
I should change android:launchMode="singleTop"
to android:launchMode="singleTask"
of my MainActivity
in manifest.xml
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With