[Aerogear-users] notifications overriding previus ones, Cordova Android

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

[Aerogear-users] notifications overriding previus ones, Cordova Android

Jesús Martín González
Hi all,

How can I show all the notifications received?, not only the last one. Something like whatsapp notifications, when there are 2 notifications, both are showed at notifications panel and not only the last one.

Using Cordova Android and  your Pushplugin

thanks

--
Jesús Martín Gonzalez
Tel: +34 654420529


_______________________________________________
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] notifications overriding previus ones, Cordova Android

Erik Jan de Wit
Hi 

This is doable, on android you have a lot of freedom how to display the messages in the notifications panel. Right now we've opted having more or less the same functionally as on iOS, but we could add this I've create an issue for it:


If your interested in adding this yourself you should take a look at 

That is where the notification is put into the Notification panel.


On Fri, Jul 31, 2015 at 1:53 PM, Jesús Martín González <[hidden email]> wrote:
Hi all,

How can I show all the notifications received?, not only the last one. Something like whatsapp notifications, when there are 2 notifications, both are showed at notifications panel and not only the last one.

Using Cordova Android and  your Pushplugin

thanks

--
Jesús Martín Gonzalez
Tel: <a href="tel:%2B34%20654420529" value="+34654420529" target="_blank">+34 654420529


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




--
Cheers,
       Erik Jan

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

[Aerogear-users] cordova push android BigText

Kelvin Lunsford
On ios the message text wraps when a long message is displayed but on android only one line is displayed by default, truncating if too long.  

In a previous thread Erik pointed out that there is a lot of freedom for how messages are displayed in the Android notifications panel by making changes to NotificationMessageHandler.java.  

I coded up a change so I could test BigTextStyle in android.  Using BigTextStyle on android lets the text wrap to multiple lines.

With the change I can use a UPS request like:
{
    "alias":["someuser"],
    "message":{
       "alert":"a long message"",
       "badge":33,
       "gglbigtxt":"a long message",
       "gglsummry":"unread count",
       "gglinfo":"33"
   }
}
to display wrapping messages in both android and ios.  Adding a summary line for the count value helps mitigate the missing badges on android.

I added the "gglinfo" key to display any value in the info area. The "msgcnt" key displays in the info area but will not display a number less than 1.

In NotificationMessageHandler.java before the line:

    manager.notify(appName, NOTIFICATION_ID, builder.build());

add:

    String tmp;
    if ((tmp = extras.getString("gglbigtxt")) != null) {
      NotificationCompat.BigTextStyle bigStyle = new NotificationCompat.BigTextStyle().bigText(tmp);
      if ((tmp = extras.getString("gglsummry")) != null)
        bigStyle.setSummaryText(tmp);
      if ((tmp = extras.getString("gglbigttl")) != null)
        bigStyle.setBigContentTitle(tmp);
      builder.setStyle(bigStyle);
    }
    if ((tmp = extras.getString("gglinfo")) != null)
      builder.setContentInfo(tmp);


I'm not recommending this be added to the plugin project as is, but it might be worth looking at.

- 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] cordova push android BigText

Sebastien Blanc
Hi !

Thanks a lot for this tip and indeed I think it's worth a discussion to see if we could add some of these (android specific)  keys to our sender API.

Sebi


On Fri, Aug 14, 2015 at 5:44 AM, Kelvin Lunsford <[hidden email]> wrote:
On ios the message text wraps when a long message is displayed but on android only one line is displayed by default, truncating if too long.

In a previous thread Erik pointed out that there is a lot of freedom for how messages are displayed in the Android notifications panel by making changes to NotificationMessageHandler.java.

I coded up a change so I could test BigTextStyle in android.  Using BigTextStyle on android lets the text wrap to multiple lines.

With the change I can use a UPS request like:
{
    "alias":["someuser"],
    "message":{
       "alert":"a long message"",
       "badge":33,
       "gglbigtxt":"a long message",
       "gglsummry":"unread count",
       "gglinfo":"33"
   }
}
to display wrapping messages in both android and ios.  Adding a summary line for the count value helps mitigate the missing badges on android.

I added the "gglinfo" key to display any value in the info area. The "msgcnt" key displays in the info area but will not display a number less than 1.

In NotificationMessageHandler.java before the line:

    manager.notify(appName, NOTIFICATION_ID, builder.build());

add:

    String tmp;
    if ((tmp = extras.getString("gglbigtxt")) != null) {
      NotificationCompat.BigTextStyle bigStyle = new NotificationCompat.BigTextStyle().bigText(tmp);
      if ((tmp = extras.getString("gglsummry")) != null)
        bigStyle.setSummaryText(tmp);
      if ((tmp = extras.getString("gglbigttl")) != null)
        bigStyle.setBigContentTitle(tmp);
      builder.setStyle(bigStyle);
    }
    if ((tmp = extras.getString("gglinfo")) != null)
      builder.setContentInfo(tmp);


I'm not recommending this be added to the plugin project as is, but it might be worth looking at.

- Kelvin

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: [Aerogear-users] cordova push android BigText

Matthias Wessendorf
I agree, would be for sure a nice option, even for the native Android lib?

On Fri, Aug 14, 2015 at 7:54 AM, Sebastien Blanc <[hidden email]> wrote:
Hi !

Thanks a lot for this tip and indeed I think it's worth a discussion to see if we could add some of these (android specific)  keys to our sender API.

Sebi


On Fri, Aug 14, 2015 at 5:44 AM, Kelvin Lunsford <[hidden email]> wrote:
On ios the message text wraps when a long message is displayed but on android only one line is displayed by default, truncating if too long.

In a previous thread Erik pointed out that there is a lot of freedom for how messages are displayed in the Android notifications panel by making changes to NotificationMessageHandler.java.

I coded up a change so I could test BigTextStyle in android.  Using BigTextStyle on android lets the text wrap to multiple lines.

With the change I can use a UPS request like:
{
    "alias":["someuser"],
    "message":{
       "alert":"a long message"",
       "badge":33,
       "gglbigtxt":"a long message",
       "gglsummry":"unread count",
       "gglinfo":"33"
   }
}
to display wrapping messages in both android and ios.  Adding a summary line for the count value helps mitigate the missing badges on android.

I added the "gglinfo" key to display any value in the info area. The "msgcnt" key displays in the info area but will not display a number less than 1.

In NotificationMessageHandler.java before the line:

    manager.notify(appName, NOTIFICATION_ID, builder.build());

add:

    String tmp;
    if ((tmp = extras.getString("gglbigtxt")) != null) {
      NotificationCompat.BigTextStyle bigStyle = new NotificationCompat.BigTextStyle().bigText(tmp);
      if ((tmp = extras.getString("gglsummry")) != null)
        bigStyle.setSummaryText(tmp);
      if ((tmp = extras.getString("gglbigttl")) != null)
        bigStyle.setBigContentTitle(tmp);
      builder.setStyle(bigStyle);
    }
    if ((tmp = extras.getString("gglinfo")) != null)
      builder.setContentInfo(tmp);


I'm not recommending this be added to the plugin project as is, but it might be worth looking at.

- Kelvin

_______________________________________________
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




--

_______________________________________________
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] cordova push android BigText

Sebastien Blanc
Yes,
that's why I directly mentioned the Sender API (so Native Lib is implicitly included ;) ) 


On Fri, Aug 14, 2015 at 8:13 AM, Matthias Wessendorf <[hidden email]> wrote:
I agree, would be for sure a nice option, even for the native Android lib?

On Fri, Aug 14, 2015 at 7:54 AM, Sebastien Blanc <[hidden email]> wrote:
Hi !

Thanks a lot for this tip and indeed I think it's worth a discussion to see if we could add some of these (android specific)  keys to our sender API.

Sebi


On Fri, Aug 14, 2015 at 5:44 AM, Kelvin Lunsford <[hidden email]> wrote:
On ios the message text wraps when a long message is displayed but on android only one line is displayed by default, truncating if too long.

In a previous thread Erik pointed out that there is a lot of freedom for how messages are displayed in the Android notifications panel by making changes to NotificationMessageHandler.java.

I coded up a change so I could test BigTextStyle in android.  Using BigTextStyle on android lets the text wrap to multiple lines.

With the change I can use a UPS request like:
{
    "alias":["someuser"],
    "message":{
       "alert":"a long message"",
       "badge":33,
       "gglbigtxt":"a long message",
       "gglsummry":"unread count",
       "gglinfo":"33"
   }
}
to display wrapping messages in both android and ios.  Adding a summary line for the count value helps mitigate the missing badges on android.

I added the "gglinfo" key to display any value in the info area. The "msgcnt" key displays in the info area but will not display a number less than 1.

In NotificationMessageHandler.java before the line:

    manager.notify(appName, NOTIFICATION_ID, builder.build());

add:

    String tmp;
    if ((tmp = extras.getString("gglbigtxt")) != null) {
      NotificationCompat.BigTextStyle bigStyle = new NotificationCompat.BigTextStyle().bigText(tmp);
      if ((tmp = extras.getString("gglsummry")) != null)
        bigStyle.setSummaryText(tmp);
      if ((tmp = extras.getString("gglbigttl")) != null)
        bigStyle.setBigContentTitle(tmp);
      builder.setStyle(bigStyle);
    }
    if ((tmp = extras.getString("gglinfo")) != null)
      builder.setContentInfo(tmp);


I'm not recommending this be added to the plugin project as is, but it might be worth looking at.

- Kelvin

_______________________________________________
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




--

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: [Aerogear-users] cordova push android BigText

Erik Jan de Wit
In reply to this post by Matthias Wessendorf
With the Android lib you'll always need to create the Handler yourself, so we can't add it there.

We already had an extra 'title' element that you could use instead of the app name, but yeah something like this might also be worth looking at. For windows we also have special messages that have a lot of formatting.

On Fri, Aug 14, 2015 at 8:13 AM, Matthias Wessendorf <[hidden email]> wrote:
I agree, would be for sure a nice option, even for the native Android lib?

On Fri, Aug 14, 2015 at 7:54 AM, Sebastien Blanc <[hidden email]> wrote:
Hi !

Thanks a lot for this tip and indeed I think it's worth a discussion to see if we could add some of these (android specific)  keys to our sender API.

Sebi


On Fri, Aug 14, 2015 at 5:44 AM, Kelvin Lunsford <[hidden email]> wrote:
On ios the message text wraps when a long message is displayed but on android only one line is displayed by default, truncating if too long.

In a previous thread Erik pointed out that there is a lot of freedom for how messages are displayed in the Android notifications panel by making changes to NotificationMessageHandler.java.

I coded up a change so I could test BigTextStyle in android.  Using BigTextStyle on android lets the text wrap to multiple lines.

With the change I can use a UPS request like:
{
    "alias":["someuser"],
    "message":{
       "alert":"a long message"",
       "badge":33,
       "gglbigtxt":"a long message",
       "gglsummry":"unread count",
       "gglinfo":"33"
   }
}
to display wrapping messages in both android and ios.  Adding a summary line for the count value helps mitigate the missing badges on android.

I added the "gglinfo" key to display any value in the info area. The "msgcnt" key displays in the info area but will not display a number less than 1.

In NotificationMessageHandler.java before the line:

    manager.notify(appName, NOTIFICATION_ID, builder.build());

add:

    String tmp;
    if ((tmp = extras.getString("gglbigtxt")) != null) {
      NotificationCompat.BigTextStyle bigStyle = new NotificationCompat.BigTextStyle().bigText(tmp);
      if ((tmp = extras.getString("gglsummry")) != null)
        bigStyle.setSummaryText(tmp);
      if ((tmp = extras.getString("gglbigttl")) != null)
        bigStyle.setBigContentTitle(tmp);
      builder.setStyle(bigStyle);
    }
    if ((tmp = extras.getString("gglinfo")) != null)
      builder.setContentInfo(tmp);


I'm not recommending this be added to the plugin project as is, but it might be worth looking at.

- Kelvin

_______________________________________________
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




--

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




--
Cheers,
       Erik Jan

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