Custom-URL-scheme icon indicating copy to clipboard operation
Custom-URL-scheme copied to clipboard

Does this work on Android?

Open chrisschaub opened this issue 8 years ago • 6 comments

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.

chrisschaub avatar Jul 18 '16 14:07 chrisschaub

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.

chrisschaub avatar Jul 18 '16 14:07 chrisschaub

Same issue. iOS working OK. Android: handleOpenURL is not defined

jlopez90 avatar Aug 08 '16 10:08 jlopez90

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" />

timonorawski avatar May 11 '17 14:05 timonorawski

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"

fanfavorite avatar May 18 '17 14:05 fanfavorite

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

seme1 avatar May 22 '17 09:05 seme1

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>

jlchereau avatar Jan 11 '18 12:01 jlchereau