I can get token by your example as below, but I have no idea how to save the token and let it use outside the function, I have tried many method, e.g. thing to declare global variables, return function value, etc, but it doesn’t work. May I know is there any idea? Many thanks.
this.platform.ready().then(() => {
FCMPlugin.getToken(
function (token) {
console.log(token);
}
};
console.log(token); // I would to pass the token value to here
}
I can get token by your example as below, but I have no idea how to save the token and let it use outside the function, I have tried many method, e.g. thing to declare global variables, return function value, etc, but it doesn’t work. May I know is there any idea? Many thanks.