Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I create iOS push notifications that don’t vibrate?

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?

like image 426
DixieFlatline Avatar asked May 20 '14 07:05

DixieFlatline


1 Answers

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.

like image 92
Tammo Freese Avatar answered Oct 27 '22 18:10

Tammo Freese