I've spent over a day on this so I'm hoping someone on here has some idea as to what is going on for me. I've implemented push notifications in my app, but when I send a notification to a device, none of the receiving function are triggered.
When the app is in the background, the notification arrives correctly, and when tapped it correctly launches the app - but the didReceiveRemoteNotification
function is never triggered, so I'm unable to handle/react to the notification.
When the app is in the foreground, neither the willLaunch
or didReceive
functions are triggered. I'm setting the UNUserNotificationCenterDelegate
in the willFinishLaunchingWithOptions
function, and when I monitor the app via the console, it shows no errors and shows willPresentNotification delivery succeeded
I have updated the Background Modes to include background fetch, background processing, and remote notifications. I have also tested this on both the Xcode simulator and a physical device with the same results. I've also tested this with push notifications coming from my server, push notifications coming from the CloudKit console, and just dropping a JSON file onto the simulator. All resulted in the same behaviour.
Does anyone have any idea why these functions might not be triggered??