-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OneSignal Cordova SDK - No custom sound / custom sound not working correctly / res/raw folder directory #510
Comments
I've got the same issue - Did anyone solve this? |
@elmbrent , @Benjyclay Can you please check in the apk if the resource is actually being added? Also, please check in the notification info that the sound is not set to Default and is set to the resource name (without the file extension) |
@rgomezp If you look at the screenshot you can see the file being added to the android directory automatically, I did check the response and it was meant to be playing the file without the extension. |
@elmbrent I know that the file is supposed to be added from looking at the screenshot, but you have to check the APK itself to see if it is actually where it is supposed to be (look in the directory itself) |
@rgomezp I've used a tool to decompile the apk and it looks like the file is there. |
@elmbrent Ok that's good. But it looks like you're not putting it in the correct directory. Solution: Make sure it is in If you take a look at our docs, you will see that the dir is different for different platforms Edit: it is in the correct directory, my mistake |
@rgomezp It is in the directory, after it is complied into an APK the whole directory structure is different you docs referenced before complied, what you are saying is the directory structure before compiling which is also correct if you look at my first message. |
@elmbrent , |
Yes it seems to be set, just the normal phone beep sounds appears though |
How about on iOS? Is it working there? |
We have not tried yet, we are doing an android release soon so we would like to get this fixed |
@rgomezp |
Try doing a recursive search through the entire project to see if it's being copied at all @AcidTr |
@rgomezp nothing was found |
If nothing was found, I don't think it has to do with the OneSignal SDK. For some reason the file isn't being copied. Try searching for reasons this could be happening |
@rgomezp as I remember the OneSignal's docs said to just put the file inside the folder < project-root >/platforms/android/res/raw/. I Already put it there and the file still wasn't copied. |
What about the |
Yes, it is! |
@rgomezp , I have just solved it. I just changed the path of the target from "res/raw/phonering.wav" to "app/src/main/res/raw/phonering.wav" |
AcidTr can you post a link of your config.xml, I think that would help me out loads! |
@elmbrent I'm using cordova 8.1.2. Maybe there's some diffrence between versions about this tag |
I will give this a try thank-you, which android version are you using? |
"cordova-android": "7.1.4" |
Thanks for following up |
This is not working with android 8.0.0 and above |
worked for me |
Take a look at our docs. It looks like you may not have it in the right path |
@sergiol29 Did you find a solution? I'm facing exactly the same problem (Android). Sound files have the correct file extension Thanks |
Does anyone have a solution? We checked and all the paths are correct and the same app receives notification sounds on Android 8 but not on Android 9. Both clean installs and updates don't make a sound. |
I fixed up the issue, I installed different versions the plugin OneSignal-Cordova-SDK (https://github.com/OneSignal/OneSignal-Cordova-SDK/releases) until the issue was fixep up (version 2.6.0) because the last version I do not worked for me |
This issue shouldn't be closed. It's still happening to a lot of people and clearly a real problem. We wanted to use OneSignal but this problem was too much for us, so we switched back to plain Firebase. We made sure all the paths are correct, the files are in correct formats, not too long, ensured that after building they are there, etc. The issue for us was that on some Android versions it worked and on others it didn't. When we switched back to plain Firebase it worked fine on every version. There's clearly a problem here.. |
Does anyone have a solution? |
Howdy,
|
Is this issue still open? The solution above is not working for me. |
I have added the file via config.xml to my res/raw directory and it is not playing my custom audio files, just the normal beep.
Added line to config.xml
See image
https://ibb.co/KVBg0ds
Environment
CORDOVA 9.0.0
Phonegap 7.1.0
Android 6.4.0
Steps to Reproduce Issue:
The text was updated successfully, but these errors were encountered: