'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
But when I do ionic cordova run android I have this as information:
the problem is that it does not display the token, please someone could help me.
Solution 1:[1]
for me the solution was:
- ionic cordova plugin remove cordova-plugin-fcm-with-dependecy-updated
- ionic cordova plugin add [email protected]
- import { FCM } from 'cordova-plugin-fcm-with-dependecy-updated/ionic/ngx';
- 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';
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:
- Copy your project to a new folder / repo, and re-install
npm install - Add the platform
ionic cordova platfrom add ios - Clear cache
npm cache clean
Solution 6:[6]
install the following plugin first
- cordova plugin add cordova-plugin-androidx
- 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 |



