Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19397] Android: Push Notification Badge Number do not reflect to App icon

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2015-09-07T07:48:39.000+0000
Affected Version/sRelease 4.0.0, Release 4.1.0
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterShuo Liang
AssigneeAshraf Abu
Created2015-08-24T02:32:19.000+0000
Updated2017-03-17T18:02:32.000+0000

Description

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,

Attachments

FileDateSize
nexusbadge.png2015-09-07T07:13:04.000+00004765712
nexusbadge2.png2015-09-07T07:13:04.000+0000316721
samsungbadge.png2015-09-07T07:13:05.000+0000184231

Comments

  1. Ashraf Abu 2015-09-07

    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.
  2. Lee Morris 2017-03-17

    Closing ticket as invalid.

JSON Source