IBM工作灯5.0.6 - 玩自定义音效上的推送通知错误 [英] IBM Worklight 5.0.6 - Play custom sound on push notification error
问题描述
我已经folow中本教程:<一href=\"http://stackoverflow.com/questions/16187608/play-custom-sound-on-push-notification-in-ibm-worklight\">Play在IBM工作灯推送通知自定义音效
但得到一个错误:
的问题是,你放在原材料
文件夹在错误的位置。结果
它应该是在 RES
文件夹中。
如果你没有在你的项目中nativeResources文件夹,只要确保创建在本地\\ res中的
文件夹,将声音文件存在。原材料
-named文件夹
正如FYI:
- 我已经导入了推送通知项目
- 更新应用程序descriptor.xml我GCM ID和密钥
-
编辑适配器的* -impl.js文件有:
WL.Server.notifyAllDevices(userSubscription,{
徽章:1,
声音:alarma.wav
activateButtonLabel:ClickMe
警惕:notificationText,
有效载荷:{
富:'棒'
}
});
块引用> -
在nativeResources的放置alarama.was
原材料
文件夹结果
- 部署适配器
- 构建和部署应用程序
- 创刊于设备运行的是Android OS V4.0.4
- 已登录用户使用伊詹
- 发通知文本测试,以用户伊詹
- 的可怕alarma声音文件我放在项目 收到了在装置
I've folow this tutorial : Play custom sound on push notification in IBM Worklight
but get an error:
The problem is that you placed the raw
folder in the wrong location.
It should be INSIDE the res
folder.
If you don't have a nativeResources folder in your project, just make sure to create a raw
-named folder in the native\res
folder and place the sound file there.
Just as FYI:
- I've imported the Push Notifications project
- Updated application-descriptor.xml with my GCM ID and Key
Edited the adapter's *-impl.js file with:
WL.Server.notifyAllDevices(userSubscription, { badge: 1, sound: "alarma.wav", activateButtonLabel: "ClickMe", alert: notificationText, payload: { foo : 'bar' } });
Placed alarama.was in the nativeResources's
raw
folder- Deployed adapter
- Built and deployed application
- Launched in device running Android OS v4.0.4
- Logged-in with user "Idan"
- Sent the notification text "test" to user "Idan"
- Received it in device with the horrible alarma sound file I placed in the project
这篇关于IBM工作灯5.0.6 - 玩自定义音效上的推送通知错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!