chemerisuk / cordova-plugin-firebase-messaging

Cordova plugin for Firebase Cloud Messaging
MIT License
164 stars 160 forks source link

Breaking changes with Capacitor 4.0 and Ionic 6 #213

Closed iamromec closed 2 years ago

iamromec commented 2 years ago

Hello,

I'm trying to migrate my old app with Ionic 6. Everything is fine but when I install this plugin, the Android build fails with the following exception:

Screenshot 2022-08-04 at 6 06 58 PM

Here is my package.json file

Screenshot 2022-08-04 at 6 08 14 PM

If I remove the plugin and rebuild it, it works fine. So I assume there are some issues with the plugin or compatibility with the latest capacitor version.

Please help. And let me know if you need more info.

chemerisuk commented 2 years ago

@iamromec it looks like capacitor doesn’t support bom dependencies yet https://github.com/ionic-team/capacitor/issues/5820#issuecomment-1204248586.

iamromec commented 2 years ago

Even if I downgrade to 6.1.0, it breaks and throws the following error on app launch.

"java.lang.RuntimeException: Cordova method createChannel does not have valid parameters"

Screenshot 2022-08-05 at 6 01 21 PM
iamromec commented 2 years ago

FYI, I have tried adding all firebase plugins to get deviceToekn like firebase, firebase x, and firebase messaging. But all of these are incompatible with Capacitor 4.0.

chemerisuk commented 2 years ago

@iamromec try to downgrade Cordova-support-android-plugin too. The error you mentioned is connected to its latest version but previous Cordova firebase plugins should use version 1.

iamromec commented 2 years ago

It worked after downgrading to cordova-support-android-plugin: ^1.0.2.

Additionally, I had to do the following things in order to make it work:

And then run the app. If these could be automated for Capacitor 4.0, it'd work smoothly.

Note: These changes are in general for Capacitor 4 and Ionic 6. Not to do anything with this plugin.

iamromec commented 2 years ago

Downgrading to 6.1.0 worked fine in Android after downgrading the support plugin as well.

But it throws errors in iOS (Xcode) while building with the latest capacitor 4.0.

iamromec commented 2 years ago

Please please make this plugin work for both platforms smoothly. It's really frustrating to upgrade/downgrade for iOS/Android to build or run the app.

chemerisuk commented 2 years ago

@iamromec it's primary a Cordova Plugin. Ask iconic/capacitor related questions on their forum.