【发布时间】:2014-08-16 21:05:11
【问题描述】:
我在使用 Android 设备上的推送通知时遇到问题(在 2.2.3 和 4.x 上测试)。在 IOS 上,该应用程序运行良好,播放默认通知声音,应该是这样。 这是我用来发送通知的代码:
function submitNotification(userId, notificationText){
var userSubscription = WL.Server.getUserNotificationSubscription('PushAdapter.PushEventSource', userId);
if (userSubscription==null){
return { result: "No subscription found for user :: " + userId };
}
var badgeDigit = 0;
var notification = WL.Server.createDefaultNotification(notificationText, badgeDigit, {custom:"data"});
WL.Logger.debug("submitNotification >> userId :: " + userId + ", text :: " + notificationText);
WL.Server.notifyAllDevices(userSubscription, notification);
return {
result: "Notification sent to user :: " + userId
};
}
我也尝试使用自定义声音;同样的结果:android 上没有声音。
【问题讨论】:
标签: android push-notification ibm-mobilefirst