IBM Worklight 5.0.6 - Play custom sound on push notification error

守給你的承諾、 提交于 2020-01-25 00:57:19

问题


I've folow this tutorial : IBM Worklight 5.0.5 - Play custom sound on push notification

but get an error:


回答1:


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


来源:https://stackoverflow.com/questions/17540459/ibm-worklight-5-0-6-play-custom-sound-on-push-notification-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!