I know how to create silent push notifications (with playing a sound file that is silent). I would also like to send a push notification that doesn't vibrate phone.
When setting silent sound file as suggested below phone still vibrates when it is locked or when the app is not active.
My payload that still vibrates:
{
aps = {
alert = {
"loc-key" = "SOME_KEY";
};
badge = 1;
sound = "silence.caf";
};
}
Is this possible?
Omitting the sound key should do the trick:
{"aps":{"alert":{"loc-key":"SOME_KEY"}, "badge":1}
The docs state that "If the sound file doesn’t exist or default is specified as the value, the default alert sound is played.". What they don't say is that if you don't provide a sound key at all, no sound will be played. If no sound is played, the phone should not vibrate as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With