phonegap / phonegap-plugin-push

Register and receive push notifications
MIT License
1.94k stars 1.91k forks source link

Can phonegap-plugin-push be updated on the npm repo? #2722

Open dfiggtns opened 5 years ago

dfiggtns commented 5 years ago

Expected Behaviour

The plugin plays nicely with other plugins like firebase-analytics.

Actual Behaviour

When trying to install the plugin, it fails with the following message:

Failed to install 'phonegap-plugin-push': CordovaError: Version of installed plugin: "cordova-support-google-services@1.2.1" does not satisfy dependency plugin requirement "cordova-support-google-services@~1.1.0". 

Reproduce Scenario (including but not limited to)

Install the latest cordova-support-google-services plugin e.g. 1.2.1 and try installing the plugin.

Steps to Reproduce

As above

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

Android: 8.0.0, ios: 4.5.5

(Android) What device vendor (e.g. Samsung, HTC, Sony...)

N/A

Cordova CLI version and cordova platform version

cordova --version                                    # e.g. 6.0.0

8.1.2 (cordova-lib@8.1.1) cordova platform version android # e.g. 4.1.1 8.0.0

Plugin version

cordova plugin version | grep phonegap-plugin-push   # e.g. 1.5.3

2.2.3

Sample Push Data Payload

N/A

Sample Code that illustrates the problem

N/A

Logs taken while reproducing problem

N/A

Description

The main problem is that the last update of this plugin on the NPM repo is 9 months old (as at 27th Feb 2019), so it contains old versions of the dependencies, which prevents it from installing, when there are newer versions of the dependency plugins installed. The only way I can get it to install is to roll back the dependent plugins by several versions e.g. I'm stuck with having to use firebase-analytics v11 when the latest version is v17.3.

Can this plugin be updated on the NPM repo with up to date dependency versions, please?

noahcooper commented 5 years ago

It looks like plugin.xml was updated after version 2.2.3, so while this is fixed in git, that fix is not reflected when using npm. Instead, you need to use the git URL when adding the plugin:

cordova plugin add https://github.com/phonegap/phonegap-plugin-push.git

It'd be great if a new version could be cut so that npm accurately reflects the most recent version of plugin.xml.

dfiggtns commented 5 years ago

FYI for anyone coming across this thread before this plugin has been brought up to date.

The way I fixed it for my configuration was to do the following changes (in both the plugins and node_modules version of the files):

Now it should play nicely with Firebase, instead of causing many days of headaches.

timothyjasonwilliams commented 5 years ago

Installing a pinned version also mitigates this issue

cordova plugin add cordova-support-google-services@~1.1.0

Then reinstalling, seems to do the trick, i.e. rm -rf node_modules plugins platforms

gaurav-chandra commented 5 years ago

Ah man! I spent 2 hours just to see that the npm version is old and I was wondering why the plugin.xml for push is not exactly same as the git version which was creating problems with fcm analytics version.

mddtrifecta commented 4 years ago

Is there any chance of this being updated any time soon?

Those who are using a rolled back version of firebase analytics, which versions are you using?

dfiggtns commented 4 years ago

It appeared that this plugin has been abandoned, so I switched to using the cordova-plugin-firebase-lib plugin, which solved all the compatibility problems I had with the various stand alone firebase plugins as it has built-in interfaces to all the various Firebase services I need to use. You can install it as normal from the npm repo.

gaurav-chandra commented 4 years ago

@dfiggtns what about ios?

dfiggtns commented 4 years ago

It's a cordova plugin, so it works for both android and ios.

gaurav-chandra commented 4 years ago

It uses fcm for ios push. Looks like we have to go via fcm route for ios also.

noahcooper commented 4 years ago

Note that using FCM for iOS is not a viable option for many people. Just as one example, for anyone using Mixpanel (and cordova-plugin-mixpanel), FCM cannot be used for iOS.

It would be great if any of the maintainers of this project could chime in.

dfiggtns commented 4 years ago

I don't believe this project is maintained any longer, so it might be worth looking for an alternative solution. I'm not familiar with Mixpanel, but OneSignal's push service might be worth looking at, if you can't use FCM directly.