Open rvanoord opened 10 years ago
I'm also interested in this issue in my app I want that acording the "hour of the day" the sound and vibration will apears with the notification or not.
Yep, I'd also like to know how to do this. I'd like to let the users to set what type (sound, vibration ,... ) of notification they get when they get a GCM push notification.
No news on this setting yet? I guess this is determined by GCM, is that correct?
Seems you can control sound, vibrate and lights by passing a value into a defaults
parameter in the payload.
The defaults
can be set to one of the constants here: http://developer.android.com/reference/android/app/Notification.html#DEFAULT_ALL
It only works with the constant value eg. 1
and not a constant name eg. DEFAULT_SOUND
.
var payload = { defaults: 1 }
Thanks for the tip bostondv! Just tried it out and if you go with the 4 for the lights option that's as good as a mute on my Nexus 5. Just add it to the data portion
'{"data":{"title":"Shhhh!","message":"Keep it down","defaults":4}}
Hi,
Several users of apps using the PushPlugin have requested the option to turn off notification sound (without necessarily turning off all sounds on the device)
Is there a way of determining whether or not Android devices play a sound when a push notification comes in and the app is in the background or not started?
RVO