1

I have an application that can detect accidents, it is really important for us to alert users using vibration and alert sound if an accident is detected.

My questions are:

  • Is it possible to add long vibration in application by using custom sounds or something that apple might be ok with?
  • If I use private apis, is it possible to convince apple to approve my app considering that the use case is really critical?
pnuts
  • 58,317
  • 11
  • 87
  • 139
Yogesh Maheshwari
  • 1,324
  • 2
  • 16
  • 37
  • possible duplicate of [Vibrate for a long time?](http://stackoverflow.com/questions/22836211/vibrate-for-a-long-time) – Mika Apr 19 '15 at 08:49

1 Answers1

1

Two questions here, really.

1st one: haptic feedback / control vibration on iOS / custom iOS patterns

No, it can't be done, even in the new Apple Watch without Jailbreaking your phone. You can have a look at this keyboard mod (needs Jailbreak). Here you have some code but it needs Jailbreaking your phone.

If you need to alert your users I recommend just playing the default vibration inside a while. Sleep the current thread for 1 sec, then vibrate again until some boolean flag changes. Objective-C Pseudocode:

while (!endVibrationAlert) {
    AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
    [NSThread sleepForTimeInterval:1];
}


// when user touches some button to dismiss alert
self.endVibrationAlert = true;

2nd one: never ever try to bypass Apple's reviewing system. Abide by the rules. For your 1st version, maybe it passes. Then, in the next update your App can get rejected.

Community
  • 1
  • 1
Diego Freniche
  • 5,225
  • 3
  • 32
  • 45
  • I read a lot of blogs about controlling or prolonging vibration and some guys also discouraged looping AudioServicesPlaySystemSound as apple has rejected apps in past for this reason (ref. http://stackoverflow.com/a/22836763/844295) – Yogesh Maheshwari Apr 19 '15 at 12:30