IBM工作灯5.0.6 - 玩自定义音效上的推送通知错误 [英] IBM Worklight 5.0.6 - Play custom sound on push notification error

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

问题描述

我已经folow中本教程:<一href=\"http://stackoverflow.com/questions/16187608/play-custom-sound-on-push-notification-in-ibm-worklight\">Play在IBM工作灯推送通知自定义音效

但得到一个错误:


解决方案

的问题是,你放在原材料文件夹在错误的位置。结果
它应该是在 RES 文件夹中。

如果你没有在你的项目中nativeResources文件夹,只要确保创建在本地\\ res中的原材料 -named文件夹文件夹,将声音文件存在。

正如FYI:


  1. 我已经导入了推送通知项目

  2. 更新应用程序descriptor.xml我GCM ID和密钥

  3. 编辑适配器的* -impl.js文件有:


      WL.Server.notifyAllDevices(userSubscription,{
          徽章:1,
          声音:alarma.wav
          activateButtonLabel:ClickMe
          警惕:notificationText,
          有效载荷:{
              富:'棒'
          }
      });



  4. 在nativeResources的放置alarama.was 原材料文件夹

    结果


  5. 部署适配器

  6. 构建和部署应用程序

  7. 创刊于设备运行的是Android OS V4.0.4

  8. 已登录用户使用伊詹

  9. 发通知文本测试,以用户伊詹

  10. 的可怕alarma声音文件我放在项目
  11. 收到了在装置

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:

  1. I've imported the Push Notifications project
  2. Updated application-descriptor.xml with my GCM ID and Key
  3. Edited the adapter's *-impl.js file with:

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

  4. Placed alarama.was in the nativeResources's raw folder


  5. Deployed adapter
  6. Built and deployed application
  7. Launched in device running Android OS v4.0.4
  8. Logged-in with user "Idan"
  9. Sent the notification text "test" to user "Idan"
  10. Received it in device with the horrible alarma sound file I placed in the project

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

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