I'm using React Native and Firebase to send push notifications. So far the Android devices I've tested are receiving local and remote push notifications as intended. There is no iOS device that remote push notification have worked for so far. Local notifications are never an issue. Push notifications are enabled within the system settings for the app.
Before sending the message I rely on code to register the token, and that has never worked for an iOS device. I have tried three IDs, nothing has worked and I'm looking for suggestions to get the token registered properly.
Here is what I have tried:
PushNotification.configure({
onRegister: function(token) {
setPushConfiguration({ token: token.token, });
// two words and 66 characters e7...-c6 etc
messaging().getToken().then(token => {
setPushConfiguration({ token });
// 8 words and 152 characters cf-...:AP..._P9...-V6...-pq...-rZ...-9y... etc
// I have also tried the hardware ID, just for kicks.
The error I get is: InvalidApnsCredential
Here is some version information:
PS > react-native --version
react-native-cli: 2.0.1
react-native: 0.61.4
PS > more .\package.json
"@react-native-community/push-notification-ios": "^1.0.7",
"react-native-push-notification": "^3.1.9",
"@react-native-firebase/messaging": "^6.3.4",
I have followed the iOS push notification documentation. Looking at the react-native-firebase-starter project, I'm not seeing where the iOS token is saved. Which 'token' is used to register an iOS device for push notifications with Firebase? Are there any poorly documented tricks to getting a token to register for an iOS device such as configuration options? I enabled the push notification capability in Xcode.