Firebase notifications don't work


#1

Hi!
I am using this plugin: https://github.com/fechanique/cordova-plugin-fcm
I use a windows pc, and when I test the app with Ionic Run Android, everything works perfect.

But when I use Ionic Package I don’t get notifications on either Android or iOS.
I do not even get the error msg.
Any suggestions?

My code:
FCMPlugin.getToken(
function(token){
console.log(token);
alert('token: ’ + token);
},
function(err){
alert('error retrieving token: ’ + err);
}
)


#2

So do you not get notifications or do you not get a token?
Your code seems to only handle getting the token, nothing about notifications…


#3

Hi thanks for reply

It seems like the code is not running.
It is under $ionicPlatform.ready(function() {
FCMPlugin.getToken(
function(token){
console.log(token);
alert('token: ’ + token);
},
function(err){
alert('error retrieving token: ’ + err);
}
)
}

As said, when I do a Ionic Run Android, it is working