Search code examples
iphoneobjective-cnotificationsvibration

notification with sound but without vibration and conversely


  • How can i use local notification with sound but without vibration?
  • And how can i use it conversely, with vibration but without sound?

edit:
while i read, i found one solution for vibration without sound:
(not appropriate to localnotifications in my case)
a) AudioServicesPlayAlertSound(kSystemSoundID_Vibrate);
b) AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
and as variant play silent sound, that will give vibration without sound effect.

and i can't use sound without vibration (we speak about local notifications). Am i right?


Solution

  • How can i use local notification with sound but without vibration?

    Vibration is always triggered if a sound is specified for the notification ( dependent on the user's settings, they may have Vibration turned off). I don't think there's currently any way of disabling vibrate for a sound-enabled notification.

    And how can i use it conversely, with vibration but without sound?

    Your guess was correct, this one is easily achieved using a silent sound file (ensure it's less than 30 seconds, the limit imposed by the notification API).