Reputation: 1
Im developing an app using React Native and Expo, the app is not bareworkflow. My App should be able to send push notifications for IOS and ANDROID, but for some reason the notications only works for ANDROID, and for IOS I get this error: DeviceNotRegistered: "ExponentPushToken[]" is not a registered push notification recipient
I got this error using expo notification tool.
This is my code implementation. Im using React 18.3.1, React Native 0.76.3 and expo 52.0.17
import * as Notifications from 'expo-notifications';
Notifications.setNotificationHandler({
handleNotification: async () => ({
shouldPlaySound: true,
shouldSetBadge: true,
shouldShowAlert: true,
}),
});
export { Notifications }
export const getDeviceNotificationPermission = async () => {
const { status: existingStatus } = await Notifications.getPermissionsAsync();
let finalStatus = existingStatus;
if (existingStatus !== 'granted') {
const { status } = await Notifications.requestPermissionsAsync();
finalStatus = status;
}
if (finalStatus !== 'granted') {
alert('Failed to get push token for push notification!');
return;
}
};
export const getDeviceToken = async () => {
const projectId = '';
await getDeviceNotificationPermission();
const token = await Notifications.getExpoPushTokenAsync({
projectId,
});
return token.data;
};
Im already read another topics about the problems but my problem looks difference cause it works fine with android.
I already set up the firebase with apple p8 certificate.
Upvotes: 0
Views: 30