EddyVerbruggen / Custom-URL-scheme

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

used to work fine from Phonegap Build repository, does no longer work from npm #213

Closed schultz-it-solutions closed 7 years ago

schultz-it-solutions commented 7 years ago

Hello Eddy, could you please give me some help here... (utilising PhoneGap Build service for the app-development).

I am using the plugin to call another app based on a custom URL schema.

This did work well as long as I referenced the plugin from the phonegap repository. But since I (had to) switch to npm, the whole thing is no longer doing what it should...

the config.xml (partly) is:

< allow-intent href="https://*.schultz.ch/*" />
< allow-intent href="myownschema://test.example.com/*" />
< access origin="https://*.schultz.ch/*" /> 

< plugin name="cordova-plugin-whitelist" spec="1.3.0" />
< plugin name="cordova-plugin-inappbrowser" spec="1.5.0" />
< plugin name="cordova-plugin-network-information" spec="1.3.0" />
< plugin name="cordova-plugin-device" spec="1.1.3" />
< plugin name="cordova_app_version_plugin" spec="0.2.6" />
< plugin name="cordova-plugin-customurlscheme" source="npm" spec="4.1.5" >
    <param name="URL_SCHEME"  value="myownschema" />
</plugin>

but when I create a javascript link to

window.open ( "myownschema://test.example.com/whatevercomeshere" );

the standard browser opens, instead of the (actually installed) "myownschema" app - and the URL is changed to a "http://myownschema://..." URL.

maybe you can spot any mistake right away, but as I am not too much expirienced, I do not know how to continue to troubleshoot this issue...

any help would be greatly appreciated!

EddyVerbruggen commented 7 years ago

I don't see a glaring mistake, perhaps others using the plugin with PGB do?

schultz-it-solutions commented 7 years ago

This is/was driving me crazy over the last three days - but I now seem to have found the issue (and of course it is not the plugin but my environment)! I try to explain here for others to benefit:

Seems like by "installing" and "uninstalling" both apps (the "calling" one and the "to be called" one) over and over again, there was a mixup in the ANDROID OS, so that the previously working connection between "mycoolapp://" schema and the "mycoolapp" app got lost.

I found this by creating a simple index.html file with a link in it and ... onsubmit=" window.open('mycoolapp://test.example.com/whatever') ;"

When I opened that link I expected to be forwarded to the second APP, but instead ANDROID asked me which APP to use for this link! HEUREKA!

You can see these settings on an ANDROID Smartphone in the TASK MANAGER -> DEFAULT Settings (where you can delete such entries).