1

I'm working on an iOS application that handles push notifications, sent with Firebase and we need to send an SMS to the device if the notification is not received (eg: the phone is offline). To do so I need to notify the server every time the app receives a push notification, by performing a HTTP request, because if the server doesn't receive this "ack", it will send an SMS. Is there a way to do this when the app is not running and is not even "sleeping" in background? I can't wait for the user to open the app, since after 30 seconds from the push notification, the server will send the SMS

AleGiovane
  • 172
  • 1
  • 13
  • 1
    The only thing that come to my mind that you could use is UNNotificationServiceExtension: https://developer.apple.com/documentation/usernotifications/unnotificationserviceextension. But I don't know if an app with this functionality will be approved on the store – LorenzOliveto Feb 14 '18 at 15:19
  • I succeeded in using the UNNotificationServiceExtension following this guite https://stackoverflow.com/questions/40040583/how-to-use-notification-service-extension-with-unnotification-in-ios10?answertab=votes#tab-top. I confirm that with this instrument I can make my app do things, even when the it is killed, when receiving a notification. Also I had to send the notifications using postman, since the body needed to contain the "mutable_content" value set to true. All I have to do now is to add an http call in the ServiceExtension. Hopefully this will cause me further problems... Thank you – AleGiovane Feb 15 '18 at 15:15
  • Did you solve problem? – yasin89 Nov 09 '22 at 13:05

0 Answers0