Native: tried calling FCM.getToken, but the FCM plugin is not installed. ionic 5

FCM: has been created
FCMPlugin.js:26 FCM: Ready!
vendor-es2015.js:103665 Ionic Native: deviceready event fired after 1 ms
vendor-es2015.js:103970 Native: tried calling FCM.getToken, but the FCM plugin is not installed.
pluginWarn @ vendor-es2015.js:103970
vendor-es2015.js:103976 Install the FCM plugin: ‘ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated’
???
its not given me the token
any help?

ok so i fix it by using this code
import { FCM } from “cordova-plugin-fcm-with-dependecy-updated/ionic”;
with out (privet fcm:FCM)
fcm.gettoken().then(re=>{

})

1 Like

Hello, I have a similar problem, I cannot get the token.

image

use this

cordova plugin add cordova-plugin-androidx-adapter
cordova plugin add cordova-plugin-androidx

and then
import { FCM } from “cordova-plugin-fcm-with-dependecy-updated/ionic”;

to get token
FCM.gettoken().then(re=>{
// ==========================
})

its gettng me blank white screen.

use it without (privet fcm:FCM)
directly

yes, I use with out it.
its give me token,
But still can’t get notification from Firebase console on that token.

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

private fcm: FCM,

it’s working fine.

It is not working in prod mode release.

we always use ionic cordova build android for android build.

can u take photo to see what happening there