-
Notifications
You must be signed in to change notification settings - Fork 1.9k
iOS push not working for device tokens when spaces removed #212
Comments
@djangojack how are you pushing the info to the device? I've never had a problem with there being no spaces in the ID. |
@macdonst I am using ionic's new push notification service. Ionic gives the option to push by device token. |
@djangojack Hmmm, that might be a problem with the way they require the device token to be formatted. I'll bring it up to Eric. |
@macdonst I talked with Ionic & they don't have any idea whats happening. Do you think there is any problem with me leaving spaces in the device tokens? Is it just a formatting convention to remove them? |
@djangojack right, well I talked to Eric. He doesn't see any reason why it shouldn't work either. I use AWS to push to iOS, never use the spaces and it just works. |
@macdonst resolved. This was caused by unregistering & re-registering tokens. Ionic is expediting un-registering a token by keeping track of them on their end, but tokens were not being re-registered. My iOS token was identical each time (unlike android), so it would fail after a single login/logout loop. Tokens with spaces worked because APNs doesn't care about spaces, and the token wasn't in ionic's list of unregistered tokens, so Ionic didn't block it. It was an anonymous token, which they allow. |
This thread has been automatically locked. |
When I register, I get the normal response:
Push Plugin register success: <502c9fd8 57dfe2d4 b9fe178b a9690b2e a906f36a 94aabf36 caf9c337 ca56656d> 502c9fd857dfe2d4b9fe178ba9690b2ea906f36a94aabf36caf9c337ca56656d
Pushes fail whenever I try to push to the device token without spaces. Pushes go through perfectly whenever I push to the token with spaces.
To make notifications work, I had to remove the following from https://github.com/phonegap/phonegap-plugin-push/blob/7052c9ce5d3b744fabaaf402bfaafe32b25736c1/src/ios/PushPlugin.m.
'stringByReplacingOccurrencesOfString: @" " withString: @""]'
Is there a reason spaces are removed from the token?
The text was updated successfully, but these errors were encountered: