Custom push Sound on Cordova application

Answered

Comments

5 comments

  • Avatar
    Roman Solomakha

    Hi,

    Please see the Pushwoosh Cordova app sample in the GitHub repo:

    Android: https://github.com/Pushwoosh/pushwoosh-sdk-samples/tree/master/Phonegap-Cordova/Android-Phonegap/res/raw

    So you should place your sound file into the res/raw folder, which should be located in the root folder of your project.

    As for iOS, you need to place the sound file in the resources folder. You can see its location in the sample app:

    https://github.com/Pushwoosh/pushwoosh-sdk-samples/tree/master/Phonegap-Cordova/iPhone-Phonegap/Phonegap-Push/Resources

  • Avatar
    Mrpro100

    You see the thing is that when I build the application I do not have access to the «res» folder. I usage Visual Studio Tools for Apache Cordova, and when I click build button everything happens automatically and on the output I get .apk file. I can not copy file to “platforms\android\res” and then build. With each new build - old folder platforms\android cleared. Is it possible set path to sound file on “www” folder?

  • Avatar
    Roman Solomakha

    Hi,

    Are you able to put the sound file into the www/res folder? If yes, could you please try to do that?

  • Avatar
    Mrpro100

    Yes I put sound file into the www/res folder and when i send push message from dashboard i set Sound: " www/res/test" - it not work.

    I resolve my problem in Visual Studio Cordova project i added sound into the foler - \res\native\android\res\raw

    After build song file copied to - \bld\Debug\platforms\android\res\raw

  • Avatar
    Earl

    For iOS, I put my sound in the resources folder, which works for the push outside of the app. Within the app, there is no sound. How do I make that work?

Please sign in to leave a comment.