I am testing by installing the app locally through XCode on my iPhone.
When I enable the push notification inside the app, everything works fine. But when I exit the app completely and reopen it later, the notification is no longer received. After I disable & enable the notification again, it starts receiving it again.
The local notification still works on restarting BTW, only the push notification stops working after restarting.
Do anyone know about this issue and how to fix it? Thanks in advance!
CodePudding user response:
without the code is hard to find a solution.
Anyway, on iOS you can't send data notification on app closed, so you have to add notification
to your notification payload.
CodePudding user response:
Turns out I didn't save the pushID in somewhere before the App is exited, which cause the app loses the data and no longer receive any notification.
I stored it to the localstorage and it works now.