繁体   English   中英

Worklight 6.1-Android推送通知到达时无声音

[英]Worklight 6.1 - No Sound When Android Push Notification Arrives

我在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上没有声音。

您无需解释如何尝试设置自定义声音,如果您提到了这会很好。

同时,请针对同一主题查看以下问题(该部门没有任何更改,因此常规步骤仍然适用):

如果不存在,请在native \\ res文件夹中创建名为“ raw”的文件夹。 将您的自定义声音文件放在此处。 确保按照上面第一个问题中的说明在代码中定义它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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