titanium android combine push notifications

224 views Asked by At

i am developing an android application which has push notifications. I am using titanium cloudpush module for recieveing push notifications. The problem is i cannot combine/group notifications.Each notification stays standalone.I would like to combine if there are two notifications. here is my recieving code

CloudPush.addEventListener('callback', function(evt) {
        if (evt.payload != null) {
        var data = JSON.parse(evt.payload);
}

});

i have used

<property name="acs-grouped-notification-message-" type="string">You have $number$ unread notifications!</property> in tiapp.xml

but no use

Thanks in advance.

1

There are 1 answers

0
Michael On

Normal grouped notifications

To group Android notifications together you need to edit your tiapp.xml to have the following:

<property name="acs-grouped-notification-message-development" type="string">You have $number$ unread messages.</property>
<property name="acs-grouped-notification-message-production" type="string">You have $number$ unread messages.</property>

-or-

<property name="acs-grouped-notification-message" type="string">You have $number$ unread messages.</property>

You have a typo in your property name: You've got:

acs-grouped-notification-message-

Delete the trailing dash, clean and rebuild your application and you should find it groups the notifications.

Internationalized and multi lingual grouped notifications

If your app is going to cater for multi lingual notifications in your i18n folder under the resources section you can add the language string:

acs_grouped_notification_message

With whatever message you want in the users preferred language.