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

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



Solution 1:[1]

for me the solution was:

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

Solution 2:[2]

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

more details here

Solution 3:[3]

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

Solution 4:[4]

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";

Solution 5:[5]

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

Solution 6:[6]

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

Solution 7:[7]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Swissa Yaakov
Solution 2 Abdellah RSMOUKI
Solution 3
Solution 4 Bogdan Nica
Solution 5 Dennis Kozevnikoff
Solution 6 buggy_coder
Solution 7 Neeraj Upadhayay