Closed TravBradfield closed 4 years ago
So I figured out what my issue was. I had not called Plugins.PushNotifications.register();
Once I had done that then I was in the clear.
closing as it seem to be sorted out
Sorry for reopening this issue but I am getting the same error message in my console and PushNotifications.register returns an empty value. I am calling it like this:
PushNotifications.requestPermission().then( result => {
if (result.granted) {
// Register with Apple / Google to receive push via APNS/FCM
PushNotifications.register().then((value) => {
console.log("registration token: ", value);
}).catch((error) => {
console.error(error);
});
} else {
// Show some error
console.error("registration failed");
}
});
The request permission dialog comes up and when I click allow it tells me: registration token: {}
I'm having the same issue. I init it in the index.tsx the following way
const setupPushNotifications = async () => {
if (!isPushNotificationsAvailable) return;
const primission = await PushNotifications.requestPermission();
if (primission.granted) {
PushNotifications.addListener("registration", (token) => {
console.log("FCMPlugin.getToken()", FCMPlugin.getToken());
console.log("registration token: ", token);
});
PushNotifications.register();
}
};
setupPushNotifications();
My log, looks like this
hey @Artkoch, FCMPlugin.getToken returns a promise, if you wait for it you should get your firebase token.
Hi There,
Great plugin. I've built a series of apps and happily integrated this plugin. However today I'm struggling to get iOS to work. I've followed all of the steps and now when running the application on an iPhone Xcode gives me the following error:
The object <FCM: 0x2810fec00> does not respond to -messaging:didReceiveRegistrationToken:. Please implement -messaging:didReceiveRegistrationToken: to be provided with an FCM token.