EddyVerbruggen / Custom-URL-scheme

:link: Launch your Cordova/PhoneGap app by a Custom URL scheme like mycoolapp://
1.03k stars 365 forks source link

Android's Custom-scheme not working #271

Open devil82426 opened 6 years ago

devil82426 commented 6 years ago

cordova version:7.0.1 node version:9.6.1 android version:6.2.3 First I got this error message: Failed to restore plugin "LaunchMyApp" from config.xml. You might need to try adding it again. Error: Error: Registry returned 404 for GET on https://registry.npmjs.org/LaunchMyApp I including the js file and setting the custom the scheme like that: (config.xml) `

    <variable name="ANDROID_SCHEME" value=" " />
    <variable name="ANDROID_HOST" value=" " />
    <variable name="ANDROID_PATHPREFIX" value="/" />
</plugin>`

(AndroidManifest.xml) in this file, it auto increase two intent-filter `

        <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:host=" " android:pathPrefix="/" android:scheme=" " />
        </intent-filter>

`

and I found someone say I need to change android:launchMode="singleTop" to singleTask But still not working on android, ios is fine. Has anyone can help me fix it?

DaveLomber commented 5 years ago

same on our side did you find any solution?

bitforcesrl commented 5 years ago

Any solution ? same issue here

gubanotorious commented 5 years ago

It looks like the package name may have changed from "LaunchMyApp" to "cordova-plugin-customurlscheme". Once I made this change in the package.json, everything worked fine.

"cordova": {
        "plugins": {
            "cordova-plugin-customurlscheme": {
                "URL_SCHEME": "customurl",
                "ANDROID_SCHEME": " ",
                "ANDROID_HOST": " ",
                "ANDROID_PATHPREFIX": "/"
            }
        },
        "platforms": [
            "android"
        ]
    }