[Aerogear-users] UPS push to IOS removes the badge

Matthias Wessendorf matzew at apache.org
Thu Jul 30 06:38:59 EDT 2015


Hi Kevin,

you mind sending a PR (pull request) to fix this bug?
Sorry for it, its a pretty annoying issue for sure!

-Matthias

On Thursday, July 30, 2015, Kelvin Lunsford <kelvin at qantel.com> wrote:

> If UPS is given a push command with no "badge" value the IOS badge icon is
> being removed when the notification is received.  Expected behavior is that
> the badge icon would be unchanged if no badge value is set.
>
> When USP receives a push command with no "badge" value it is sending APNS
> a "badge" value of -1.
>
> The Apple push payload spec says the badge icon is removed if the "badge"
> value is 0, and the icon is unchanged if there is no "badge" value.  The
> spec does not say what happens if the "badge" value is less than zero.
>
> Tested devices are removing the badge icon when -1 is set.
>
> Please change UPS so no "badge" value is sent to APNS when the UPS command
> has no "badge" value.
>
> For example you could change the sendPushMessage function of
> APNsPushNotificationSender.java to:
>
>   PayloadBuilder builder = APNS.newPayload()
>     // adding recognized key values
>     .alertBody(message.getAlert())
>     //.badge(message.getBadge()) // do not set badge here
>     .sound(message.getSound())
>     .alertTitle(apns.getTitle())
>     .alertAction(apns.getAction())
>     .urlArgs(apns.getUrlArgs())
>     .category(apns.getActionCategory())
>     .localizedTitleKey(apns.getLocalizedTitleKey());
>
>   if (message.getBadge() >= 0)
>     builder.badge(message.getBadge()); // only set badge if needed
>
> - Kelvin
>
> _______________________________________________
> Aerogear-users mailing list
> Aerogear-users at lists.jboss.org <javascript:;>
> https://lists.jboss.org/mailman/listinfo/aerogear-users
>


-- 
Sent from Gmail Mobile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/aerogear-users/attachments/20150730/ff176c81/attachment-0001.html 


More information about the Aerogear-users mailing list