1

Our app has to receive silent notification from a service to work properly. Like check-in now with location info...etc. It worked perfectly before IOS13. However it stopped working since the update. The phone receive the silent notification but IOS never wakes the app to process it if the app is in background. I use the new headers :

request.Headers.Add("apns-id", Guid.NewGuid().ToString("D"));
request.Headers.Add("apns-push-type", "background");
request.Headers.Add("apns-priority", "5"));
request.Headers.Add("apns-topic", {BundleId});

My payload worked before however I tried the one from Apple docs as well still no luck :

{ "aps" : { "content-available" : 1 }, "acme1" : "bar", "acme2" : 42 }

I found on Apple forum few workarounds like send empty alert object..etc. I tried all of them still no luck. And this all worked perfectly before IOS13!

Is anyone have any idea what is going on with the silent push notifications now on IOS13 and how to actually send one ?!

Update: maybe important info, I can send alerted notification so pushtoken..etc must be ok. Also, when the phone connected to the Mac (not debugging, only connect trough USB) I get the silent notifications and the app waken up as before.

fra
  • 186
  • 1
  • 12
  • 1
    Starting in iOS 13, the description attribute of the deviceToken data sent to the push token delegate in iOS changed to a different format. Many existing applications and software libraries use this attribute to fetch the push token by accessing the description variable on the deviceToken NSData instance, and then trimming certain characters from it to get the device push token . Check https://onesignal.com/blog/ios-13-introduces-4-breaking-changes-to-notifications/ – Lucas Zhang Dec 03 '19 at 12:56
  • Hi Lucas, that already fixed in the app. The device token must be fine because I can send alerted notification but not silent one. – fra Dec 03 '19 at 12:59
  • Check https://stackoverflow.com/questions/57871677/ios-13-silent-push-notifications-are-no-longer-reliable – Lucas Zhang Dec 03 '19 at 14:02

1 Answers1

2

Found a workaround! I send a normal alerted message with the proper alert header, but add the content-available:1, then IOS13 does not show the notification, only lights the phone up for a sec, and wakes my application to process the message! I have to send NOT the silent message format (with the "background" header)!!!, but the proper alerted message, like a normal push notification, but with content-available included!

fra
  • 186
  • 1
  • 12
  • Don't forget to accept your answer , which will help more people . – Lucas Zhang Dec 09 '19 at 08:56
  • @fra Can you please explain li'l more about this work-around. I'm facing the same issue. – Peeyush karnwal Jun 03 '20 at 06:03
  • @Peeyushkarnwal They fixed it since. I just send the message like : {"msgID":"212","cmd":"ForceCheckIn(Service)","aps":{"content-available":1}} and the header now says : {[apns-push-type, background]} It works on IOS 13.5 – fra Jun 04 '20 at 15:47
  • @fra okay. Well, I was testing on iOS 13.4 and its not working right now. is it fixed on 13.5 ? We are using Node APN latest version at the BE btw. Like, earlier I also realized that previous version was not supporting pns-push-type – Peeyush karnwal Jun 05 '20 at 04:23
  • it works for me, however i don't use any addons etc as i couldnt find any which actually works. I ended up to write my own service to communicate with APNS in .net core. Since IOS 13.4 it works with no issue. You can try the original workaround. You set the pns-push-type to "alert" but send the pn with content-available=1 – fra Jun 06 '20 at 13:15