Post

Replies

Boosts

Views

Activity

Reply to Push notifications functions never triggered
Thank you for responding for quickly - I agree that I've almost certainly misunderstood how the notifications system works, I'm just struggling to figure out where that misunderstanding lies. I'll give a bit more info just so we're on the same page: I can confirm that I'm definitely using the application(_:didReceiveRemoteNotification:fetchCompletionHandler:) function I have the content-available:1 in the payload (see below the test payload I'm using) The function application(_:didReceiveRemoteNotification:fetchCompletionHandler:) is never called - I've attempted >50 tests with both the CloudKit console and dropping the JSON payload onto the simulator and I've never had this function trigger - is this something that is expected? From your wording I would expect it to be triggered at least some of those times, but it appears to be consistent so far I'm only using the application(_:willFinishLaunchingWithOptions) function to set the delegate for the UNUserNotificationCenter The launch function I was referring to is the userNotificationCenter(_ :willPresent:withCompletionHandler) function - this function is never triggered when the app is in the foreground, even though my console that is attached reads willPresentNotification delivery succeeded` This is the payload I'm using to test this functionality - could it be something wrong in the payload itself that could cause the notification to not be delivered to the app? { "aps": { "content-available": 1, "alert": { "title": "Test Push", "body": "Success! Push notification in simulator! 🎉", "sound": "default" } } } Thanks again!
Oct ’24