IPhone SDK - Vibration caused by stream

I am currently working on an iPhone application that should make the phone vibrate if a special event occurs.

Checks to trigger an alert are performed on the thread.

Unfortunately, the phone will not vibrate if I call

 AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

from inside the stream. (It works fine if I call this in my viewDidAppear method).

I even tried making a callback inside thead like this:

 inside Thread:
 [self performSelectorOnMainThread:@selector(doAlarm) 
                                               withObject:nil 
                                            waitUntilDone:true];    

 -(void)doAlarm {
   AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);            
 }

which has the same result: no vibration on the phone.

How to make the phone vibrate from the stream?

Thanks in advance

+3
source share
1 answer

Got it!

The microphone receiver was activated, which caused the problem.

+1
source

Source: https://habr.com/ru/post/1743697/


All Articles