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.
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.
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
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.
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.
© 2022 - 2024 — McMap. All rights reserved.