ionic-team / ionic-plugin-deeplinks

Handle deeplinks into your Ionic/Cordova apps from Universal Links, App Links, and Custom URL schemes. For those using Ionic 2, there are some nice goodies that make life easier.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ionic 3 Deeplink relaunches the app by creating new app instance, however, later attempts work fine (Issue only in Android 9)

mshaikh7 opened this issue · comments

I have been recently working on an Ionic 3 based Cordova Android application and have been researching from last few days on the below issue, any help would be highly appreciated:

My app opens another 3rd party installed app via inAppBrowser.create(url, '_system') successfully, and once I complete the activities on that app, it calls my app back via ionic-native-deeplinks plugin.

At first invocation, deeplink relaunches my app again instead of resuming my already running app instance and creates multiple instances of my app. However, all the later invocations work fine, it comes back to my app without relaunching/restarting the app.

This issue is only happening in Android 9, it is working fine in lower Android versions. Also, reading through multiple blogs, I saw that most people suggest to set

<preference name="AndroidLaunchMode" value="singleInstance" />
I tried that and it works, the deeplinks works fine on the first attempt without creating a new instance and relaunching the app. However, setting this launch mode for my app causes other issues, so I do not want to use this.

Is there any way I could set just ionic-native-deeplink plugin's launch mode to "singleInstance" or is there any other way I could go about solving this or understanding this issue.

Let me know if you need more details like code snippet, package versions, etc. to help understand better.

Thanks in Advance!!