Push Notifications Error

Hi, I'm experiencing an issue with my app. I use Firebase as my server, and it is great. Still, there is one issue: when I send push notifications from my app to users, the users will get the notification if the app is open, but not when it is closed. I have tried many solutions to fix it, even asking AI, but the issue is still there. I would be happy to give you access to Firebase and the Xcode workspace, as I have no clue how to fix it.

That would mean your notifications is depending somehow on the app being active.

Simple push notifications will be shown whether the app is active or not. Indeed, just the opposite of what you are observing would happen: if the app is closed, the notification would be shown, but when it is open, first the system will ask the app what to do with the notification, show it, or absorb the information.

One explanation I could have is, you are using the content-available flag to send silent notifications, in hopes it would wake up the app, and then creating a visible notification within the app.

If that's your process, it will only work reliably if the app is open. If it is not, depending on the app state, the processing you are doing will be possible from incidental to none.

If you can share the apns-id of one of these notifications you say was not shown, we can check if anything in particular might have gone wrong with it from the sending point of view, or this is likely an app side issue.

Push Notifications Error
 
 
Q