问题
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:
- 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
来源:https://stackoverflow.com/questions/17540459/ibm-worklight-5-0-6-play-custom-sound-on-push-notification-error