Open phiasco12 opened 2 years ago
@phiasco12 Try this code instead
cordova.plugins.firebase.messaging.requestPermission().then(function() {
cordova.plugins.firebase.messaging.getToken().then(function(token) {
alert("Device token", token);
}).catch(function(error){
alert(error.message);
});
});
cordova.plugins.firebase.messaging.requestPermission().then(function() {
cordova.plugins.firebase.messaging.getToken().then(function(token) {
alert("Device token", token);
}).catch(function(error){
alert(error.message);
});
});
@chemerisuk, I tried these codes but still getting empty token, please help out
Any success here? I've the same problem catch is never triggered since the string is returned empty.
Hi,
When I run this code in iOS, I get the permission request and when I allow it, I get the
alert(Device Token )
And there's no token!I get no errors at all to indicate any issues!
this is the code: