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

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

I send the file name to my payload:

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

But now I don’t know where to put the sound file in my Ionic project.

I have to put it in res / raw. But is it inside my platform? Can someone tell me the correct path starting from the root directory?

+4
source share
1 answer

I found the answer:

You should put this:

platforms/android/res/raw/filename.mp3

For iOS, I put it here:

platforms/ios/res/raw/filename.mp3

In your settings, it is important that you provide the file name WITHOUT file type:

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

Source: https://habr.com/ru/post/1673982/


All Articles