Open peterlauri opened 6 years ago
@pataar huh, that's weird as the OS should take care of the badge. Can you give me a full example of your push payload?
Hi @macdonst, I think you mentioned the wrong person haha.
@pataar I sure did.
@peterlauri huh, that's weird as the OS should take care of the badge. Can you give me a full example of your push payload?
@macdonst you refer to the payload sent to FCM or the payload received by the plugin?
@peterlauri the one sent to FCM
@macdonst here you go. I removed some private information.
{
"android": {
"priority": "high"
},
"data": {
"somedatakey": "participant_read_message"
},
"notification": {
"badge": 0
},
"to": "XXX"
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@peterlauri sorry, been busy but I believe this is a bug in the push implementation. It seems like we should be setting
[UIApplication sharedApplication].applicationIconBadgeNumber=[[userInfo objectForKey:@"aps"] valueForKey:@"badge"];
Expected Behaviour
When application is in foreground and push with badge count only is received the badge icon should update.
Actual Behaviour
When application is in foreground and push with badge count only is received the badge icon is not updated.
Reproduce Scenario (including but not limited to)
App in foreground
Steps to Reproduce
Have app in background, send push with badge=100, badge=100 Enter app (foreground), send push with badge=10, put app in background... badge is 100, and not 10.
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
iOS=11.2.6
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Cordova CLI version and cordova platform version
Plugin version
2.2.2
Sample Push Data Payload
Sample Code that illustrates the problem
Logs taken while reproducing problem
WORKAROUND with cordova-plugin-badge