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

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Kelvin Lunsford
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
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

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

Matthias Wessendorf
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 <[hidden email]> 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
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;Aerogear-users@lists.jboss.org&#39;)">Aerogear-users@...
https://lists.jboss.org/mailman/listinfo/aerogear-users


--
Sent from Gmail Mobile

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

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

Kelvin Lunsford
Sorry Matt,

Not ready to be a real contributor yet. Just a user. No git account.

This looks like a 3 line change to me. Not big enough to learn everything required to do a PR.

I might sign up later for a bigger change, but that's another topic.

- Kelvin


------------------------------------------------------------------------------------
From: [hidden email] [mailto:[hidden email]] On Behalf Of Matthias Wessendorf
Sent: Thursday, July 30, 2015 3:39 AM
To: [hidden email]
Subject: Re: [Aerogear-users] UPS push to IOS removes the badge

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 <[hidden email]> 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
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users


--
Sent from Gmail Mobile

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

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

Daniel Passos
On Thu, Jul 30, 2015 at 9:48 PM, Kelvin Lunsford <[hidden email]> wrote:
Sorry Matt,

Not ready to be a real contributor yet. Just a user. No git account.

I understand your point here but I cannot agree with you. Notify about a possible bug/whatever is a real contribution.

Thank you for that.
 

This looks like a 3 line change to me. Not big enough to learn everything required to do a PR.

I might sign up later for a bigger change, but that's another topic.

- Kelvin


------------------------------------------------------------------------------------
From: [hidden email] [mailto:[hidden email]] On Behalf Of Matthias Wessendorf
Sent: Thursday, July 30, 2015 3:39 AM
To: [hidden email]
Subject: Re: [Aerogear-users] UPS push to IOS removes the badge

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 <[hidden email]> 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
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users


--
Sent from Gmail Mobile

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



--
-- Passos

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users
Reply | Threaded
Open this post in threaded view
|

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

Matthias Wessendorf
Hi Kelvin,

I finally added the PR you suggested:

-M

On Fri, Jul 31, 2015 at 2:08 PM, Daniel Passos <[hidden email]> wrote:
On Thu, Jul 30, 2015 at 9:48 PM, Kelvin Lunsford <[hidden email]> wrote:
Sorry Matt,

Not ready to be a real contributor yet. Just a user. No git account.

I understand your point here but I cannot agree with you. Notify about a possible bug/whatever is a real contribution.

Thank you for that.
 

This looks like a 3 line change to me. Not big enough to learn everything required to do a PR.

I might sign up later for a bigger change, but that's another topic.

- Kelvin


------------------------------------------------------------------------------------
From: [hidden email] [mailto:[hidden email]] On Behalf Of Matthias Wessendorf
Sent: Thursday, July 30, 2015 3:39 AM
To: [hidden email]
Subject: Re: [Aerogear-users] UPS push to IOS removes the badge

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 <[hidden email]> 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
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users


--
Sent from Gmail Mobile

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users



--
-- Passos

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users




--

_______________________________________________
Aerogear-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-users