How can I set that device should vibrate if a push notification come to my application?
5 Answers
I just figured out one way to do this: if you want to phone to only vibrate on receipt of a push notification, you need to have a silent sound file in your application bundle, for example "silence.aif" ... if you specify that sound file in the APS notification, the iOS device will "play" the silence.aif from your application bundle, but since the sound is silence, there is nothing to hear. However the notification vibration is still triggered :-)

- 271
- 2
- 3
-
i want only vibrate no sound .. so how can i apply ? thank x in advance – ramesh bhuja Jun 28 '16 at 07:44
-
Hi, Jesse! May you tell how exactly you created the *silence.aif*? Was it a pure silence or some tone with very low magnitude? – kelin Jul 11 '17 at 20:11
I don't think it is possible to instruct the notification to vibrate. If you set a sound using soundName
the notification will vibrate if the iPhone has Vibrate set to ON in Settings > Sounds, i.e. it depends on the settings of the individual iPhone.

- 10,010
- 13
- 53
- 70
-
ok.... but whenever a push notification comes to facebook app the phone also vibrate. any idea on this? – Saurabh Dec 03 '10 at 13:22
-
-
Does it vibrate even if you turn off the vibrate setting in your phone? – Robert Höglund Dec 03 '10 at 13:33
-
@RobertHöglund i want only vibrate no sound .. so how can i apply ? thank x in advance – ramesh bhuja Jun 28 '16 at 07:44
Setting sound : "default" makes it vibrate for me. Even when phone is not on silent, it plays no sound and only vibrates.

- 1,933
- 2
- 11
- 7
-
I use UMeng Push, I set the Sound "default" but not work, still sound & vibrates both occur. – Gank Sep 07 '14 at 07:11
-
i want only vibrate no sound .. so how can i apply ? thank x in advance – ramesh bhuja Jun 28 '16 at 07:45
-
You just need call this line:
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)

- 188
- 1
- 5
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 the iPhone has Vibrate set to ON in Settings > Sounds,and remove "sound="silence.caf",the end will be: doesn't vibrate

- 120
- 6
-
The first paragraph answers the opposite of the question (how to **prevent** vibrate). Moreover, it is a copy-paste of my answer to the opposite of the question: http://stackoverflow.com/questions/23752957/how-can-i-create-ios-push-notifications-that-don-t-vibrate/23968896#23968896 – Tammo Freese Jul 16 '14 at 09:08