-
-
Notifications
You must be signed in to change notification settings - Fork 197
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
Are sounds implemented yet? #9
Comments
Not sure about push in simulator - it might have quirks - the sound issue not sure - havent used it my self |
should work in 2.3.0 but QA is needed, havent tested sound at all - but its implemented |
Hi @adamgins I get the sound on android when the notification arrives without writing sound:true at all |
@pefi1011 thanks. Yep, that's what I have. If I send the test payload (using one of those APN test apps) it works:
but not using this package. |
It should work now |
Hi, still having an issue with sounds... Do I need to put my own sound file somewhere in the project? I see code refers to |
@adamgins try the 2.3.3 - I've updated the path to the sound file. It should be placed in the meteor If you cant get sound to work we might have to try and use the server prefix instead. |
Hello @adamgins Did you get the sound to work? |
yep, I have same issue. It works fine on Android but cannot get sound to work on iOS. Been flatout on other stuff to come back and look at it. @raix wondering if it works for you? |
Havent tested this part fully yet |
@insaneinc01, @adamgins, This may be a long shot, but does this work: sound: 'default' if in call, or: "sound": "default" if in config. |
It's been a while since I have looked at this issue. Anyone get sounds working on iOS yet? |
@hellogerard @adamgins I'm trying only on iOS though. |
works fine for me after adding org.apache.cordova.media plugin |
@maabed sounds cool - If you guys can confirm that adding the cordova.media plugin solves this we should prop. consider making the media plugin a dependency? |
@maabed tried your suggestion, but it still doesn't work :( I did add org.apache.cordova.media. |
ok! I finally got the sounds working. Just the default native iOS push sound, not customized sounds. config.push.json never worked for me. It always gets stuck on the Meteor splash screen. So I used @spencercarli suggestion here: #21 (comment)
And in push.send call:
Note the value - |
regarding:
Have you tried using I've filed an issue on this but they want a replication - I'm not sure I can |
Hi @raix , Btw, since my requirement is only to trigger the default Push sound on iOS, the org.apache.cordova.media plugin is really not needed. |
@insaneinc01 super :) I actually thought the sound was HTML5 why the media plugin is a bit of a surprise. |
Hi folks, great stuff... just catching up here. So, am I reading correctly:
to the client? thanks |
Ah by the way, if I add the I am only calling it once in the client code. But I am using the |
The config.push.json creates the specific Push.Configure in each environment - so you should only use one of the config methods - The sound should be set true in the config and in the push send you reference the sound file as string |
thanks… I was just trying that … but seemed to be getting an issue after installing Cordova media plugin.. do I actually need it? On 9 Feb 2015, at 5:59 pm, Morten N.O. Nørgaard Henriksen notifications@github.com wrote:
|
I dont think the media is required - but I'm not sure - playing sound on ios is triggy |
@adamgins The Cordova media plugin is not needed if you only need to trigger the default native push sound on iOS. |
Thanks @insaneinc01 ok sound playing now while app is open only. Is there something else I need to do so it plays if the app is closed? |
Hi, this started working for whilst the app was closed... not sure if it was an udpate...anyway, closing this. Thanks for all the help folks. |
I haven't tested sound yet since shifted to the new cordova plugin - please let me know if you find a bug |
Solved! This may be a work around, but it does work and it works consistently. None of the above methods worked for me, however the following does work. You will want to add a new folder under the following path in your project > .meteor/local/cordova-build/platforms/android/res/ , add a folder called raw . In the raw folder add your sounds. The resulting folder is the exact location that the sounds are being referenced from in android. To see for yourself, you can run your app on a device and log the errors. Do the following:
--- Indeed the app is trying to reference a file that does not exist. Thats why creating a new directory called raw and placing the file inside it does the job. *** PLEASE NOTE! IN THE PUSH NOTIFICATION - I ALSO REMOVED THE FILE EXTENSION ***.mp3 Push.send({ I hope this helps. Matt |
I'll try this out and let you know if I can replicate the success. It's a
|
@mvgalle brilliant solution! Here's where it's documented in the cordova plugin I added this to my build before the meteor command. It may require the app to have already been built once.
I tried naming the file |
@mvgalle it's works! thanks |
i can't get it working to play the default sound on IOS. in config.push.json i have: the alert is working and badge too but the sound is not working |
@mvgalle Great! Thanks for sharing, this works. If anyone is still having issues with this problem, here's a summary of what worked for me, from start to finish, using a custom modification of Create
Next, we need to add
Your
Your calls to
|
Clever @Streemo ! Thanks for posting this! |
nice guys - should we add the solution to the docs or somehow improve the api? |
Is this eventually handled by this package? Perfect solution would be to keep the audio file somewhere and add a filepath to mobile.config so that it's automatically added into res/raw folder when building. |
The cordova-build-override folder might help http://guide.meteor.com/mobile.html#advanced-build I can confirm that this solution worked for me on Android.
@raix can you add this into the docs and update the example app? Possible solution for iOS (NOT TESTED): Push.send({
...
apn:{
//this should work because we added audio files in the public folder
//so this file will be copied to cordova build into the path below
sound: "www/application/app/sound.wav",
...
},
gcm: {
//this will refer to the audio file we placed in /cordova-build-override
sound: "sound",
...
}
}) |
anyone tested Possible solution for iOS (NOT TESTED): for iOS? |
@java99 Exactly. |
@philipthomasme where do you write this piece of code ? |
@sahanDissanayake I think you specify it in Push.send configuration, see my post above. |
yep sweet :) working through it right now. wasn't 100% sure because you had ... after the sound is defined.. But I will give this a shot Also I'm thinking from your post that For Android it is mp3 and for IOS it is WAV format ? Thanks |
I can only confirm that for Android it's MP3. For iOS I didn't implement it yet. But I've seen people using .wav for iOS in the posts above. |
@maabed Perfect solution on the top.. Everything is working ( I had the ipad on silent mode.. DUHH!!! ) Thanks |
hi @maciejsaw since you are one of the few poeple that got the plugin to work on Android maybe you might have an idea There are no badge on the icon and also if you send multiple push notifications from the server then one notification on the phone is replaced by the next notification on ANDROID, Which means there is always one ONE notification on tray 😢 raix:push@3.0.0-rc.2 My cordova-plugins
|
I have the same problem of only one notification but I didn't try to solve With the badges I wouldn't worry too much if it doesn't work, android os On 00:01, Wed, May 25, 2016 sahanDissanayake notifications@github.com
|
For custom sounds you are unable to use MP3 (iOS restriction I believe), you need to use WAV or CAF. If you have an mp3 you can simply run the following to convert your mp3 via the terminal.
|
The solution that @maciejsaw proposed worked for me. To make it work in iOS I had to add nested iOS configuration found here. If it's set in the root of configuration object as described in the docs, iOS doesn't pick it up.
We're on version 3.0.3-rc.2 of the push plugin, I'm not sure if this issue was addressed in later versions. |
Does anyone know why the sounds stopped working according to this scheme? |
I figured it out! Need to transfer files from |
Yes, for meteor 1.8.1 ≥ you need to put your resources in |
now at least everyone can find out) |
HI,
anything I am missing to get sounds to work?
here's my init:
BTW, they seem to work fine on iOS if I am using one with push simulators.
The text was updated successfully, but these errors were encountered: