Simulating Push Notifications in iOS Simulator
This article is originally published at https://swiftsenpai.com
Dear fellow iOS developers, the wait is finally over! We are now able to simulate push notification in iOS simulator using the latest Xcode beta release (11.4-beta).
Without further ado, let’s see how this can be done.
The Steps
In order to be able to simulate a push notification in iOS simulator, there are a few steps that need to be taken.
- Download and install Xcode 11.4-beta and above.
- Create a sample app that requests for permission to receive push notifications.
- Run the sample app and grant it permission.
- Put the sample app into the background.
- Create an Apple Push Notification Service (APNS) payload file.
- Drag and drop the payload file onto the target simulator.
Now let’s go through these steps in detail one by one.
1. Download and install Xcode 11.4-beta and above
By the time this article is being published, Xcode 11.4 is still under beta release. Thus, you can download it here.