Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I try to implement push notification in android mobile app. Using
cordova-plugin-firebase-messaging
i can send push notification to android mobile using firebase console , but what happen those are installed apk file , all are receive push notifications, but i want to send to specific users, so i want to get FCM token.

What I have tried:

What i am tried, in 'index.js' file, onDeviceReady function i call the below function to get token.
Java
document.addEventListener('deviceready', onDeviceReady, false);

function onDeviceReady() {

    FCMPlugin.onTokenRefresh(function(token){
        alert( token );
    });

    FCMPlugin.getToken(function(token){
        alert(token);
    });

}


When i build and install apk file and open in mobile device, but nothing show when open device.
My Cordova version is 11.0.0
and installed plugin is
cordova-plugin-fcm-with-dependecy-updated 7.8.0 "Cordova FCM Push Plugin"


Any reply much appreciate.


Regards
Aravind
Posted
Updated 3-Nov-22 22:37pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900