Trying to get permission to send push notifications fails

When I try to get permission to send push notifications with apple I get

“Error: The device was unable to register for remote notifications with Apple”

This is my code

  const { status: existingStatus } = await Permissions.getAsync(
  let finalStatus = existingStatus;

  // only ask if permissions have not already been determined, because
  // iOS won't necessarily prompt the user a second time.
  if (existingStatus !== 'granted') {
    // Android remote notification permissions are granted during the app
    // install, so this will only ask on iOS
    const { status } = await Permissions.askAsync(Permissions.NOTIFICATIONS);
    finalStatus = status;

I got it from here:

I’m trying on an iPhone 8 simulator
Any ideas?

Push notifications do not work on iOS simulator (this is an Apple restriction). Try testing on a real device instead.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.