简体   繁体   中英

titanium android combine push notifications

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM