Open zechs424 opened 5 years ago
same behaviour happening for me, Only problem with Android, Working fine on iOS My Android version is 7.0 on Samsung device
var push = PushNotification.init({ ios: { badge: true, sound: true, alert: true } });
on some event (last parameter badge count): push.setApplicationIconBadgeNumber(() => ({}),() => ({}), 20);
Same here. Working fine recieving badge number inside application, getting success in background, but badge doesn't appear on app icon (version 2.2.3)
N.B. getApplicationIconBadgeNumber returns correct count number. But it just doesn't show up visually.
Expected Behaviour
The badge number is updated on app icon
Actual Behaviour
The badge number is remain the same. if I am using json object with only "data" object only, the badge number can update successfully. But for iOS, if I send json object with only "data" object, the notification will not show. So I send the json object with both "data" and "notification" object and found android's app icon badge cannot update.
Reproduce Scenario (including but not limited to)
send FCM notification using http method using json object with both "data" and "notification" object present
Steps to Reproduce
send fcm notification by http method using the following json object: { "to" :,
"notification": {
"title": "hih",
"body" : "hey",
"badge": 20
},
"data": {
"title": "hihi",
"message": "hey",
"android_channel_id": ,
"badge": 20
}
}
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
Android 8.0 (API 26)
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Sony
Cordova CLI version and cordova platform version
Available platforms: browser ~5.0.1 osx ~4.0.1 windows ~5.0.0 www ^3.12.0
Plugin version
phonegap-plugin-push 2.2.3 "PushPlugin"
Sample Push Data Payload
{ "to" :,
"notification": {
"title": "hih",
"body" : "hey",
"badge": 20
},
"data": {
"title": "hihi",
"message": "hey",
"android_channel_id": ,
"badge": 20
}
}
Sample Code that illustrates the problem
using http method of send fcm notfication from server side
Logs taken while reproducing problem