【问题标题】:titanium android combine push notifications钛 android 结合推送通知
【发布时间】:2015-02-04 13:34:25
【问题描述】:
我正在开发一个具有推送通知的 android 应用程序。
我正在使用钛 cloudpush 模块来接收推送通知。
问题是我无法合并/分组通知。每个通知保持独立。如果有两个通知,我想合并。
这是我的接收代码
CloudPush.addEventListener('callback', function(evt) {
if (evt.payload != null) {
var data = JSON.parse(evt.payload);
}
});
我用过
<property name="acs-grouped-notification-message-" type="string">You have $number$ unread notifications!</property> in tiapp.xml
但没用
提前致谢。
【问题讨论】:
标签:
titanium
titanium-mobile
appcelerator
appcelerator-acs
【解决方案1】:
普通分组通知
要将 Android 通知组合在一起,您需要编辑 tiapp.xml 以具有以下内容:
<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>
您的住宿名称中有错字:您有:
acs-grouped-notification-message-
删除尾部破折号,清理并重建您的应用程序,您应该会发现它对通知进行了分组。
国际化和多语言分组通知
如果您的应用要在资源部分下的 i18n 文件夹中处理多语言通知,您可以添加语言字符串:
acs_grouped_notification_message
使用用户首选语言的任何信息。