Can we test iOS push notification on Xcode 8 simulator without having programmer membership ?
Asked Answered
B

4

10

I am just a beginner and trying to implement push notification in my app, but not getting any proper guide. The main problem is that I don't have the programmer membership. If it is possible to do without having actual membership, please explain it in clear and straight forward way.

Boykin answered 19/10, 2016 at 13:3 Comment(0)
O
13

No.

Push notifications go from your server to Apple's server to a device that registered for those notifications. That cannot work without Apple's cooperation somewhere in the middle, so a developer membership is needed.

Oast answered 19/10, 2016 at 13:7 Comment(2)
Okey. Thank you very much. I read few things about "mock remote notification", but as a beginner I am unable to understand exactly what it is and how to use it. Could please explain?Boykin
@ShrikantPanchal Did you get the answer for mock remote notification? Do we need to enroll to the Apple developer program?Heteroplasty
S
4

Upgrade your machine to Catalina OS, download Xcode 11.4.

Collect simulator device identifier, bundle identifier and .apns file

Add this test content in .apns file

{ "aps":{ "alert":"Test drop", "sound":"default", "badge":3 } }

Run this command : xcrun simctl push Device Identifier Bundle Identifier .apns file name

Example : xcrun simctl push 8E1C327E-4B05-4190-AEA1-0646E73A3A49 com.Pushnotification test.apns

And run this command

Reference has taken from this link

Schoolteacher answered 11/4, 2020 at 7:5 Comment(1)
Just as a sidenote, this works on the iOS Simulator exclusively. For testing on a real iOS device, you still need to use the developer certificate and use Apple Push Notifications service. Also, these simulated notifications can't be used to rest Rich Push Notifications, those only work for remote notifications (a.k.a real notifications on a real device).Mendicity
A
0

You can test push notification only on real device if you have membership or you can manage certificate, you never able to test push notification on simulator. For push notification Device need to be register on APNS with a device token. Only real device are able to register.

Andyane answered 19/10, 2016 at 13:12 Comment(0)
M
0

From onward Xcode 11.4 Beta you can test push notifications on iOS simulator. The Xcode 11.4 Beta release notes

The simulator supports simulating remote push notifications, including background content fetch notifications. In Simulator, drag and drop an APNs file onto the target simulator. The file must be a JSON file with a valid Apple Push Notification Service payload, including the “aps” key. It must also contain a top-level “Simulator Target Bundle” with a string value matching the target application‘s bundle identifier.

Mikesell answered 7/2, 2020 at 7:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.