When I use
WL.Server.notifyAllDevices(userSubscription, {
badge: 1,
sound: "notification.wav",
activateButtonLabel: "ClickMe",
alert: notificationText,
payload: {
foo : 'bar'
}
});
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:
raw
under the existingnative\res
folder inyourProject\apps\yourApp\android\native
raw
folderWhen sending a notification it should now play your custom sound file.
You can also place the sound file in a
raw
folder underyourProject\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 thenative
folder for whichever reason.