4

I want to trigger one of the custom vibrations that are in iOS 7 (you can see them when going into the native Contacts application and editing a contact) when my app gets a push notification. Is that possible? The best thing would be to specify the name of the vibration-alert in the push notification - but I don't think that's possible.

Another option would be to set a local notification with one of those custom vibrations (right after a push notification comes in). Is that possible?

Is there any other way for my app to use a vibration which is not the default one? I know about this method AudioServicesPlayAlertSound(kSystemSoundID_Vibrate); What I'm looking for is to put in another argument to make the iPhone vibrate differently.

In the answer to this question there's an explanation of how to create a custom vibrate, but it uses some of Apple's internal methods, which to my understanding Apple does not approve.

UPDATE: Does anyone know if this is possible for iOS 8?

Community
  • 1
  • 1
bobsacameno
  • 765
  • 3
  • 10
  • 25

1 Answers1

0

I've been struggling with this last week in iOS 8 too. Still there is no way to change the default vibration duration.

The function

AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)

produces a vibration that lasts 4 milliseconds with one millisecond of silence. I've tried to chain the same function call several times but there is always an interruption between two calls. I think there is no way to make a lengthy vibration that lasts more than 4 milliseconds :(

VíctorVarLed
  • 148
  • 1
  • 8