I am new to React Native and am trying to create push notifications on iOS with push-notification-ios and react-native-push-notification. I am following a number of different tutorials on this as I am still learning how it works.
When I run my app I get the following error.
Here is my code
const configure = async () => { console.log('push notification configured'); PushNotificationIOS.addEventListener('registrationError', (e) => { PushNotifcation.configure({ onRegister: function(token) { //process token alert('Token!'+ JSON.stringify(token)); console.log('[CATCHED] onRegister:', token); db.setToken(token).catch( console.log('[ERROR] device push token has not been saved on the database'), ); }, onNotification: async function(notification) { console.log('[CATCHED] onNotification:'+ JSON.stringify(notification)); let notifType = ''; if (Platform.OS === 'ios') { notifType = getNotificationType( JSON.parse(notification.data.data).type, ); } else { notifType = getNotificationType( notification.type, ); } //process the notification //required on iOS only if (Platform.OS === 'ios') { notification.finish(PushNotificationIOS.FetchResult.NoData); } }, senderID: '-----', permissions: { alert: true, badge: true, sound: true }, popInitialNotification: true, requestPermissions: true, }); });}export { configure,};