Custom-URL-scheme
Custom-URL-scheme copied to clipboard
Does this work on Android?
Does this plugin work on Android? It seems to launch my app, but a new or reset instance? All of my data is gone, sort of like the app is restarted. And this data is in a pouch database -- not simple local storage. Using latest build, phonegap build and Ionic Framework.
I am also getting this error after clicking a link to open the app from a web link ...
Error in Success callbackId: LaunchMyApp301641494 : ReferenceError: intent is not defined
iOS is working fine.
Same issue. iOS working OK. Android: handleOpenURL is not defined
I was just running across an issue like this, what was happening for me was a second instance of the app was being launched.
Fixed by adding this to my config.xml
<preference name="AndroidLaunchMode" value="singleInstance" />
The AndroidLaunchMode preference fixes this issue. If you are using PhoneGap, this preference doesn't work, but check out this doc: http://docs.phonegap.com/phonegap-build/configuring/preferences/
Basically you need to add this to your config.xml file:
<config-file platform="android" parent="/manifest/application" mode="merge">
<activity android:launchMode="singleTop" />
</config-file>
You will also need to make sure to have this attribute in your widget tag:
xmlns:android="http://schemas.android.com/apk/res/android"
The preference line causes other Android plugins [such as Camera and MultImagePicker] to stop working as they require separate instances of the app to work as I mentioned in this issue https://github.com/EddyVerbruggen/Custom-URL-scheme/issues/204
The following works with:
- cordova-plugin-customurlscheme,
- cordova-plugin-local-notifications,
- cordova-plugin-safariviewcontroller,
- cordova-plugin-x-socialsharing,
- phonegap-plugin-barcodescanner (which uses the camera), among other plugins, both on Android and Amazon Fire OS:
<widget ...>
<config-file parent="/manifest/application" platform="android">
<activity android:launchMode="singleTask" android:allowTaskReparenting="true" />
</config-file>
</widget>