cordova-plugin-fcm-with-dependecy-updated not working ionic 5

Viewed 11648

I installed cordova-plugin-fcm-with-dependecy-updated by following the ionic documentation and made all the necessary firebase configurations. I imported FCM into app modules. Then I put the notification code in my app.component.ts

enter image description here

But when I do ionic cordova run android I have this as information:

enter image description here

the problem is that it does not display the token, please someone could help me.

enter image description here

8 Answers

for me the solution was:

  1. ionic cordova plugin remove cordova-plugin-fcm-with-dependecy-updated
  2. ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated@7.2.0
  3. import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx';
  4. ionic cordova run android

I had the same issue. I solved it by importing { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic';

more details here

I had the same issue, Try to import FCM with this: import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx';

I had the same problem. Instead of importing FCM from the npm package, import it like this directly from the cordova package:

import { FCM } from "cordova-plugin-fcm-with-dependecy-updated/ionic/ngx";

Try this:

  1. Copy your project to a new folder / repo, and re-install
    npm install
  2. Add the platform
    ionic cordova platfrom add ios
  3. Clear cache
    npm cache clean

install the following plugin first

  1. cordova plugin add cordova-plugin-androidx
  2. cordova plugin add cordova-plugin-androidx-adapter

now

import fcm as import { FCM } from "cordova-plugin-fcm-with-dependecy-updated/ionic/ngx";

remove platforms and add them again then build the project again

I had the same problem, I followed the below steps and it worked.

1-delete the node_modules folder. 2-run npm i.

my issue was due to incomplete or maybe corrupt installation of the package.

I solved my problem using onesignal

Related