Reputation: 186
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.
Upvotes: 1
Views: 2388
Reputation: 186
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!
Upvotes: 2