IBM Worklight 5.0.5 - Play custom sound on push notification

后端 未结 1 529
傲寒
傲寒 2021-01-26 09:49

When I use

WL.Server.notifyAllDevices(userSubscription, {
        badge: 1,
        sound: \"notification.wav\",
        activateButtonLabel: \"ClickMe\",
               


        
相关标签:
1条回答
  • 2021-01-26 10:16

    To use a custom notification sound:

    1. If the folder does not exist already, add a folder named raw under the existing native\res folder in yourProject\apps\yourApp\android\native
    2. Place the sound file in the raw folder

    When sending a notification it should now play your custom sound file.

    You can also place the sound file in a raw folder under yourProject\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 the native folder for whichever reason.

    0 讨论(0)
提交回复
热议问题