Thank your for your reply and time Matt :)
I already have local push notifications as you describe above up and running in the app, similar to your setup. I have my own push server (awfully close to the sample code push server in the Simple Push Example ;)). Using that I can send some JSON to my NEAppPushProvider implementation where I can decode the JSON and convert it into a UNMutableNotificationContent object and add it to the UNUserNotificationCenter where it is presented on my device.
I would however also be interested in sending a "Silent" push notification from my server...or more exact, based on content I receive from the server I will create a "background notification" (somehow) which would then cause some background work to run on my device, similar to what is described here: https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app. I've therefore tried adding the "content-available: 1" property in the userInfo of the UNMutableNotificationContent before I add it to the Notification Center. I have set up the device as mentioned in the above documentation, but the application(_:didReceiveRemoteNotification:fetchCompletionHandler:) function is not called as expected.
I guess I get why this isn't working. I mean, I am trying to use a Local Push Notification to trigger some background work, and I seem to remember that this is not possible...but I would like to get confirmation before I venture further down that rabbit hole :)
Topic:
App & System Services
SubTopic:
Networking
Tags: