I am getting an empty string after registering to the APNS


Our app uses APNS to send notiification to the user

We are getting an empty string at times.

I have put internet connectivity as of the moment as a interim solution.

would it be possible to know if anyone has experienced this and what were the solutions to this?


I do remember having the same bug before. It just work after 24 hours.


We need it as part of our process.


Is this the push notification text or the push notification tokens?


For push notification text

TBH, im not sure the difference between the two


I think this is a different issue. I think this issue is more of a backend thing. That’s what I suspect. I think you can check the json being sent to the apple server.

Probably this has something to do with the format: Make sure the title isn’t empty or the body.

  1. {
  2. "aps" : {
  3. "alert" : {
  4. "title" : "Game Request",
  5. "body" : "Bob wants to play poker",
  6. "action-loc-key" : "PLAY"
  7. },
  8. "badge" : 5
  9. },
  10. "acme1" : "bar",
  11. "acme2" : [ "bang", "whiz" ]
  12. }


i think its th token we are having issues with

below is thte code we are using.

func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
// Convert token to string
let deviceTokenString:String? = deviceToken.reduce("", {$0 + String(format: “%02X”, $1)})
print(“device token : (String(describing: deviceTokenString))”)



Ohhh… Probably it’s an OS bug. You can try waiting tomorrow and see if works that’s my experience. This happens when you change the push notification certificates.


Its been failing for 4 days for IOs ver 12.0.1 and 12.1


Have you turn on the Push notifications capabiilities in Xcode and have the entitlement files loaded in Xcode?


Yeah, the weird thing is in all of our test scenarios there are no issues but when some people from US test it they get empty deviceuids