Search code examples
cordovatemplatespush-notificationphonegap-pluginsphonegap

Misunderstanding phonegap-plugin-push version


I had some troubles using the phonegap-plugin-push.

First of all, I tried to insert it in my app using, in the config.xml file, this line:

<plugin spec="https://github.com/phonegap/phonegap-plugin-push.git" source="git" />

I think this is the better solution, BUT the plugin isn't included when I create the template of my app.

So, I tried to use this version

<plugin name="phonegap-plugin-push" spec="1.9.0">
    <param name="SENDER_ID" value="1111" /> 
</plugin>

In this way the plugin was correctly added in the template, but this version isn't correct for iOS, it works only for android.

So, using cordova cli tool, I added this plugin from command line, to check what will be written in confing.xml file. I got this:

<plugin spec="~1.10.5" name="phonegap-plugin-push"/>

In this way the plugin is included in the template, but I can't understand the version. Why there is "~" next to the version? Which version is this? Is it the last one? I know the last is 2.x, but this has a "1" as first number...

can you give me some help here?

UPDATE: Summarized all the steps here: https://programmingistheway.wordpress.com/2017/07/19/devextremephonegap-how-to-manage-push-notifications-with-fcm/


Solution

  • If you wanna install the latest version (2.0.0-rc5) of phonegap push plugin using Cordova CLI, try out this command:

    cordova plugin add [email protected]