iOS: Production push notifications, Invalid token from APNS server
I re-downloaded the push production certificate and exported it from the keychain as .p12. This seems to have solved the problem. It seems strange though that a bad private key was giving me the "Invalid Token" error.
Invalid Token VoIP Apple Push Notification
Finally i found the solution.
Its my mistake, since i created my p12 certificate from apple push notification certificate instead of voIP push notification certificate.
I followed this link in SO
https://stackoverflow.com/a/40760469/6059583
That link provided me with a tool which gets all the certificates from toolchain.
After choosing push notification certificate, i gave a try with voIP push notification certificate to send a notification.
And i got my push notification from my server.
If incase someone seems to be having invalid token, kindly make sure the certificate is correct.
You can also use the link given by iDeveloper, that tool also seems nice.But u need to select the certificates and give it to the tool.
iOS Push notifications : invalid tokens
Is your device id (Device Token) is correct?
Invalid token when using Apple Push Notifications (APN) for Passbook
If you are using a pruduction certificate to connect to the APN production server, you must use a production token.
The fact that you get "invalid token" when sending the notification to the sandbox server means you are using a production token, which works only with the production server.
The fact that sending the token to the production server returns the token in the feedback service means that the application that matches the certificate (which your server is using to send the notification) is either uninstalled from the device or has push notifications disabled. Perhaps you are using a wrong certificate (perhaps a certificate that belong to a different App that was uninstalled from the device).
Related Topics
Swift - Aws S3 Upload Image from Photo Library and Download It
How Can One Enable Keyboard Like in Imessages/Fb Messenger in Landscape Mode at iOS8
Mkannotationview and Tap Detection
Removing Lagging Latency in Drawing Uibezierpath Smooth Lines in Swift
iOS Multiple Right and Left Align on Same Line
How to Set Uibutton Type in Uibutton Subclass
How to Add External Webvtt Subtitles into Http Live Stream on iOS Client
iOS 7.0 and Arc: Uitableview Never Deallocated After Rows Animation
Grouping Coredata by Date() in Swiftui List as Sections
How to Check Text Field Input at Real Time
How to Ignore Certain Uitouch Points in Multitouch Sequence
Sprite Kit Set Min. and Max. for Jump