Skip to content
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

Custom Sounds not working. #138

Open
mvgalle opened this issue Oct 22, 2015 · 7 comments
Open

Custom Sounds not working. #138

mvgalle opened this issue Oct 22, 2015 · 7 comments

Comments

@mvgalle
Copy link

mvgalle commented Oct 22, 2015

Followed several ideas and examples per and indicated for custom sound using raix/push. However, I am still not getting the custom sounds to play. I either get the default notification sound, or no sound at all. My config.push.json looks like this (and the actual push notifications do indeed appear):

{
"gcm": {
"apiKey": "xxxxxxxx",
"projectNumber": xxxxxxxxxx
},
"production": false,
"badge": true,
"sound": true,
"alert": true,
"vibrate": true
}

I have a server method to send the push notification:

'sendNotification': function(id,username){
Push.send({
from: 'push',
title: 'My App',
text: username + ' Pushed You!',
sound: '/sounds/mySound.mp3',
badge: 1,
query: {
userId: id
}
});
}

I have tried adding cordova.media.plugin but that did not help. All I need is to have a custom push sound. Any help or thoughts for how I could proceed would be great. Thanks everyone.

@Streemo
Copy link

Streemo commented Nov 16, 2015

I saw you commented this on a different thread. I commented there, but I might as well join this too. I think you have to specify www/application at the beginning of your sound path, since that's where cordova stores assets. Some people say to make it www/application/public ? But if you go exploring in the build, my "meteor public root" is actually under www/application/app. I've brute-force tried all of these path combinations, and none of them work.

@Streemo
Copy link

Streemo commented Nov 21, 2015

@dennisharrison I see you've manually added the file. I thought putting it in /public would do this. I tried doing this, but the builder yelled at me and told me to change api.addFiles('/path/to/sound.mp3','client') to api.addAssets('/path/to/sound.mp3','client'). It looks like the bundle contains the audio file at the right path. Keep posted.

@Streemo
Copy link

Streemo commented Nov 21, 2015

@dennisharrison Awesome -- this worked on iOS. For Android, it's very strange.

I have a Galaxy S3, running Android 4.4.2, and I keep getting two different kinds of notifications. Apps like default Messaging will notify me with a double-vibrate, whereas apps like Gmail, MyMeteorCordovaApp, LinkedIn, etc. notifications are a single vibrate with longer duration, which seem to not play sound even if I have notifications' sound on the max. My default Messaging app will notify me with sound.

Does anyone else notice how there are two "types" of notifications on Android -- these GCM push notifications seem to be of the single-vibrate no-sound kind. I am not sure how to normalize these two types of notifications. Is there a setting somewhere?

Thanks.

@MichaelJCole
Copy link

@dennisharrison did you get this to work on Android?

After a day of testing, and looking through the code, I don't think this works on Android:

See #156

@dennisharrison
Copy link
Collaborator

@MichaelJCole @Streemo

It works with Android with the pinned versions in that project. I don't know about current versions. I'll be updating everything to Meteor 1.2.1 over the holidays here as time permits (side-side-side project ;p)

Best of luck, and if I find anything relevant for updated versions I'll update.

Happy Turkey Day!

@MichaelJCole
Copy link

Ok awesome. Super helpful. It looks like the update to 3 has an issue on Andriod. Downgrading is probably the most compatible option.

You too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants