EddyVerbruggen / Custom-URL-scheme

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

Plugin won't install via Visual Studio #215

Open wizlonuk opened 7 years ago

wizlonuk commented 7 years ago

I'm attempting to install the plugin by opening the config.xml, selecting Plugins, the Custom tab and entering both the PluginID (cordova-plugin-customurlscheme) or the Git repo URL (https://github.com/EddyVerbruggen/Custom-URL-scheme), however I am getting the following error:

"Visual Studio was unable to parse plugin.xml. Please ensure plugin.xml exists and contains no errors."

I've previously had no problems installing via visual studio, through a plugin Id or Git, is this a genuine issue, or is this not supported?

Thank you

jeffreypoen commented 7 years ago

Just add to you config.xml the following lines, works for me:

<vs:plugin name="cordova-plugin-customurlscheme"> <param name="URL_SCHEME" value="YOUROWNSCHEME" /> </vs:plugin>

Brain2000 commented 7 years ago

I can't get it to install either.

neoassyrian commented 7 years ago

I can't get it to install either cordova-plugin-customurlscheme

Fuchur84 commented 6 years ago

Same here... is there any fix for that available ow what did you all do to get it working?

EddyVerbruggen commented 6 years ago

Perhaps it's related to the unbound 'uap' prefix. I've added the namespace import to the plugin.xml - can you try installing from GitHub?

Fuchur84 commented 6 years ago

Hi Eddy, thanks for having a look into this. I just tried it with Visual Studio and the GitHub branch, but there still seems to be a problem, but I am quite sure the uap-prefix-addition is very likely a good idea. Do you have any other idea, what could be happening there?

Fuchur84 commented 6 years ago

Okay, the problem is the line 102 and 104 in the file plugin.xml.

If I change this:

<uap:Extension Category="windows.protocol">
        <uap:Protocol Name="$URL_SCHEME" />
</uap:Extension>

To this:

<Extension Category="windows.protocol">
        <uap:Protocol Name="$URL_SCHEME" />
</Extension>

Now Visual Studio can analyse the Plugin.xml again. :) I'll test if everything is working then tomorrow.

Best regards Fuchur

EddyVerbruggen commented 6 years ago

Awesome, looking forward to your follow up!

Fuchur84 commented 6 years ago

Okay, got it working with this. Just replace the -part in plugin.xml with:

<!-- windows -->
    <platform name="windows">
      <config-file target="package.windows.appxmanifest" parent="/Package/Applications/Application/Extensions">
        <Extension Category="windows.protocol" StartPage="www/index.html">
          <Protocol Name="$URL_SCHEME" />
        </Extension>
      </config-file>
      <config-file target="package.windows80.appxmanifest" parent="/Package/Applications/Application/Extensions">
        <Extension Category="windows.protocol" StartPage="www/index.html">
          <Protocol Name="$URL_SCHEME" />
        </Extension>
      </config-file>
      <config-file target="package.phone.appxmanifest" parent="/Package/Applications/Application/Extensions">
        <Extension Category="windows.protocol" StartPage="www/index.html">
          <Protocol Name="$URL_SCHEME" />
        </Extension>
      </config-file>
      <js-module src="www/windows/LaunchMyApp.js" name="LaunchMyApp">
        <clobbers target="window.plugins.launchmyapp" />
      </js-module>
</platform>

Thanks again for this great plugin :).

Best regards Fuchur

PS: Leave windows 8 and wp8 as it is. That should be fine. PPS: Of cause this only works, if the page to handle the url should be "www/index.html" (which is most often the case). Otherwise it would need to be replaced. Maybe you could implement an additional variable for that with the info, that in general it is "www/index.html".

EddyVerbruggen commented 6 years ago

Hey @Fuchur84, thanks for the suggestion! As I'm not using the Windows platform I can't test this, but I have swapped the config for yours (also, the hook has been removed from the config, I think that's what you intended to do).

Would be great if a few folks can give the current GitHub master a try - I'll leave this open until then.