IBM工作灯5.0.5 - 玩自定义音效推送通知 [英] IBM Worklight 5.0.5 - Play custom sound on push notification

查看:107
本文介绍了IBM工作灯5.0.5 - 玩自定义音效推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用

WL.Server.notifyAllDevices(userSubscription, {
        badge: 1,
        sound: "notification.wav",
        activateButtonLabel: "ClickMe",
        alert: notificationText,
        payload: {
            foo : 'bar'
        }
    });

推送通知IBM在Android上工作灯5.0.5,它似乎没有可以使用的自定义声音选项。无论身在何处,我把声音文件,工作灯没有找到它。根据客户端的痕迹,它甚至不搜索该文件。有没有人尝试过​​这种成功?

to push a notification in IBM Worklight 5.0.5 on Android, it does not seem to be possible to use the custom sound option. No matter where I put the sound file, Worklight does not find it. According to the client traces, it does not even search for the file. Has anybody ever tried this successfully?

推荐答案

要使用自定义通知声音:

To use a custom notification sound:

  1. 如果该文件夹不存在,添加一个名为在现有的本机\ RES 文件夹中的文件夹 yourProject \ APPS \ yourApp \机器人\本地
  2. 将在声音文件中的文件夹
  1. If the folder does not exist already, add a folder named raw under the existing native\res folder in yourProject\apps\yourApp\android\native
  2. Place the sound file in the raw folder

当发送通知,现在要发挥您的自定义声音文件。

When sending a notification it should now play your custom sound file.

您也可以放置在 yourProject \在文件夹中的声音文件APPS \ yourApp \机器人\ nativeResources \ RES ;这将确保该文件将被复制到在构建您所产生的Andr​​oid项目,如果你删除了本地文件夹中任何原因。

You can also place the sound file in a raw folder under yourProject\apps\yourApp\android\nativeResources\res; this will make sure the file will be copied to your generated Android project upon build, in case you have deleted the native folder for whichever reason.

这篇关于IBM工作灯5.0.5 - 玩自定义音效推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆