Problem Reproduce:
1. Simple run the following code in a default app. (Register for token and subscribe to a channel)
var CloudPush = require('ti.cloudpush');
var Cloud = require('ti.cloud');
CloudPush.retrieveDeviceToken({
success: function deviceTokenSuccess(e) {
alert('Device Token: ' + e.deviceToken);
Cloud.PushNotifications.subscribeToken({
device_token: e.deviceToken,
channel: 'alert',
type: 'android'
}, function (e) {
if (e.success) {
alert('Success');
} else {
console.log('Error:\n' +
((e.error && e.message) || JSON.stringify(e)));
}
});
},
error: function deviceTokenError(e) {
alert('Failed to register for push! ' + e.error);
}
});
CloudPush.addEventListener('callback', function (evt) {
alert(evt.payload);
});
2. Send a simple notification from dashboard, with badge: "+2".
3. Received the notification from device successfully.
Expect:
The App icon should show badge 2.
Actual:
The App icon did not change at all.
Note:
Print the payload from device is like following:
{"android":{"sound":"none","alert":"test","vibrate":false,"badge":2}}
Seems the badge is delivered to device successfully, but the mobile did no handle it well,
Documentation on Badge: [http://docs.appcelerator.com/arrowdb/latest/#!/api/PushNotifications] According to the documentation, on android:
On Android, the badge number is displayed in the notification center, while on iOS, the badge number is displayed with the application icon.
It is not suppose to reflect on the app icon. Instead, it is shown in the notification center. I'm attaching a few images to show where the badge is reflected in the notification for android. [^nexusbadge.png][^nexusbadge2.png][^samsungbadge.png] In this case, I had a badge number of 10 and I added +1 in the dashboard for push. This caused it to update to 11. This is the intended way it is working. Therefore this is not a bug. [~sliang] I will resolve this as an invalid bug.Closing ticket as invalid.