0

I am currently trying to know when a device received a push notification, while the app is being in the background state. I have done research before posting this but I feel like we would need a clearer answer.

I can send and receive notifications perfectly but in fact, I would like to update the badge number of the app while it is the background state. But I find funny that there isn't any explicit answer to a functionality necessary for almost every app.

I hope someone could help me to solve this problem.

clmrie
  • 78
  • 7
  • What did you mean by `clearer answer.`? What did you try that didn't work? – Desdenova Aug 02 '19 at 11:28
  • @Desdenova I don't understand how "DidreceiveRemoteNotification" or any other function linked to notifications can't be read whereas the device *shows* the notification – clmrie Aug 02 '19 at 11:32
  • 1
    Possible duplicate of [How to update badge number when receive push notification](https://stackoverflow.com/questions/46598362/how-to-update-badge-number-when-receive-push-notification) – Desdenova Aug 02 '19 at 11:34
  • @Desdenova Ok ty I will try it and post the answer if it succeeds – clmrie Aug 02 '19 at 11:36
  • Try this https://stackoverflow.com/a/50044201/5084797 – manishsharma93 Aug 02 '19 at 11:38
  • @Desdenova, unfortunately, I can't fix it... "DidReceive remote notification" is not called even in "completionHandler"... – clmrie Aug 02 '19 at 16:03

0 Answers0