To test remote push simply drag an APNS file onto the target simulator. This method requires the payload to contain the "Simulator Target Bundle" key. Otherwise, you will get this error message:
Invalid push notification: The file does not contain a valid JSON payload or the Simulator Target Bundle key is missing.
So add "Simulator Target Bundle" to your payload file:
{
"aps" : {
"alert" : {
"title" : “Namaste”,
"body" : “This is iOS development notification test“
},
},
"Simulator Target Bundle": "com.sarunw.example-xcode-11-4"
}
The following simctl command in terminal will send notifications, and since the bundle identifier is included in the command, it does not need "Simulator Target Bundle" to be in the file:
xcrun simctl push <device> <bundle-identifier> <path-to-apns-file>
(<device>
can be "booted" if you only have one device running in Simulator. Otherwise use xcrun simctl list
to see a list of them, and copy the UUID of the one you want to send to.)