Open dfiggtns opened 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.
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):
In plugin.xml make sure the following lines match the version on your project (in v2.2.3 the line numbers are: 42, 46 and 85):
`
In docs/src/ios/PushPlugin.m, change:
@import FirebaseMessaging;
to:
@import Firebase;
and delete or comment out the following line:
@import FirebaseAnalytics;
this is because the newer version of Firebase only requires the base module to be imported, as it does everything else itself.
Then remove/install the ios platform to be sure the plugin changes have been pulled in.
Now it should play nicely with Firebase, instead of causing many days of headaches.
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
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.
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?
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.
@dfiggtns what about ios?
It's a cordova plugin, so it works for both android and ios.
It uses fcm for ios push. Looks like we have to go via fcm route for ios also.
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.
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:
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
8.1.2 (cordova-lib@8.1.1) cordova platform version android # e.g. 4.1.1 8.0.0
Plugin version
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?