Where to put custom sound file for push notifications in Ionic 2 for Android

前端 未结 1 1220
时光取名叫无心
时光取名叫无心 2021-02-09 21:01

I am using the push plugin in my Ionic 2 app. Now I want to use a custom sound file.

I am sending the file name in my payload:

options = {data: {title: \         


        
1条回答
  •  梦毁少年i
    2021-02-09 21:37

    I found the answer:

    You have to put it in:

    platforms/android/res/raw/filename.mp3
    

    For iOS I put it here:

    platforms/ios/res/raw/filename.mp3
    

    In your options it's important that you inform the filename WITHOUT the filetype:

    options = {data: {title: "Title", body: 'Body.', soundname: 'filename'}}
    

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