Skip to content

docs(@capacitor/push-notifications): Add common issue about iOS simulator support and device tokens #2025

@matthewbal

Description

@matthewbal

Feature Request

Plugin

  • push-notifications

Description

Add a short section into the readme to let developers know that the iOS simulator does not support push notification registration.
I spent too long trying to figure out why the registration and registrationError listener events were not firing for me, and it turns out that for me, on Xcode 14.2 with an ios 16.1 simulator, the failure is totally silent and simply doesn't fire the event didRegisterForRemoteNotificationsWithDeviceToken or didFailToRegisterForRemoteNotificationsWithError in the appdelegate (confirmed with print statement debugging).

I confirmed that my project works fine on a physical device, so it is indeed only the iOS simulator which doesn't support registering a device token.

Platform(s)

Docs only

Preferred Solution

Adding the section into the readme.

Alternatives

There might be a way to detect if the user is in a simulator and throw an error to the registrationError event.

Additional Context

https://stackoverflow.com/questions/1080556/how-can-i-test-apple-push-notification-service-without-an-iphone/60085404#60085404

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugA confirmed bug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions