Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push notification badges not appearing?

I'm using Urban Airship to send push notifications to my app

eg:

{"aps": {"badge": 2, "alert": "Part 2 of the August Issue is ready to download!", "sound": "default"}, "device_tokens": ["X"]}

The alert will display perfectly, however the app icon is never badged regardless of what I set "badge":# to...

Is my payload incorrect or is there extra code I'm supposed to add to my app to handle badges as well as alerts? Thanks!

EDIT: I'm registering for push notifications like this:

// Register for notifications
    [[UIApplication sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeNewsstandContentAvailability | UIRemoteNotificationTypeBadge | UIRemoteNotificationTypeAlert)];
like image 641
N S Avatar asked Dec 27 '22 12:12

N S


1 Answers

I was running with a similar problem. After a few minutes of checking around. I notice that there was a problem with my server side code. I found out that badge value has to be implicitly set as an integer to get the desired result. Hope that helps anyone reading this.

like image 151
Jiraheta Avatar answered Jan 15 '23 03:01

Jiraheta