I'm working an on iOS game and recently tested on an iPhone 4S. Siri activates sometimes when my thumb covers the proximity sensor. This is a feature of the 4S. Instead of holding the home button, users can put the phone to their ear to activate Siri. But in my game the activation is not intended and it interrupts gameplay.
Can Siri be disabled within an app? Is this an iPhone 4S bug?
Setting :
[UIDevice currentDevice].proximityMonitoringEnabled = YES;
Disables Siri from activating when you activate the proximity sensor. As a result although, it blacks out the screen when the proximity sensor is activated instead.
Apple deprecated support for this.
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIApplication_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/occ/instp/UIApplication/proximitySensingEnabled
I'd file a bug report.
Discussion
YES if proximity sensing is enabled; otherwise NO. Enabling proximity sensing tells iOS that it may need to blank the screen if the user's face is near it. Proximity sensing is disabled by default.
This the replacement which only allows you to get notification, not disable it.
Discussion
Enable proximity monitoring only when your application
needs to be notified of changes to the proximity state. Otherwise,
disable proximity monitoring. The default value is NO.
http://developer.apple.com/library/ios/DOCUMENTATION/UIKit/Reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/doc/uid/TP40006902-CH3-SW25
Related
I'm building a Unity Cardboard app, and would like to detect when the device is in the headset. The NFC in theory has this data, but it does not seem to be exposed in the API. I would like to have the app automatically enter VR mode when in the headset, without the user needing to toggle in and out of a VR mode.
Basically, I want Cardboard.vrModeEnabled to be automatically updated when you enter or exit a headset.
Is this possible? Thanks!
It used to be in the (non-Unity) SDK but was deprecated, for several reasons. For one, the NFC sensors on phones are placed in different places, so the detection was not uniformly reliable. For another, using the sensor this way drains battery quickly.
There are a lot of cardboard models on the market. a lot of them don't come with an NFC tag. so i wouldn't count on it.
Best approach for me is to start in VR mode, when the user touches the screen, disable VR mode for 10 seconds since the last touch and then go back to VR mode.
I locked the iPhone by calling the method GSEventLockDevice()from GraphicsServices.framework. It's working fine on the iPhone , but after locking the phone the backlight doesn't turn off. It remains lit and it shows the unlock screen.
How can I make the screen turn off immediately after locking?
Why are you doing this. Apple never accept this kind of private framework tasks. It must be jailbreak app. GraphicsServices.framework not deals with backlight and screen ON and OFF state. it just deals with GSEvents and other graphical things. I think you can't do that .
If you are developing for a jailbroken phone you could use GSEventSetBacklightLevel(0); to dim the brightness level.
So here's my problem: I have alerts come from my app fairly often. I've made it so they have a custom ring and vibration for when the alerts come. I want to be able to make their LED light flash on alerts as well.
I've set it up so that if these alerts come when the app is in the foreground, the LED flash and ring/vibrate work perfectly fine. However, if an alert comes when the app is in the background, I am only able to have the ring/vibrate work.
I don't want the user to have to enable it in the iPhone system settings to get LED flash alerts from all apps. I have used the inAppSettingsKit and added a settings preference for whether or not the user wants LED flash alerts. But even though my LED alert methods are called in the background, the LED does not actually flash. Is this because Apple does not allow you to control the LED unless your using it in the foreground? Does anyone know of a workaround?
Here's the simplest part of where I have it turned on and off. I control this with different timers and notification methods. The timers and notifications are called in the background the same way they are in the foreground, however the LED just doesn't turn on in the background.
AVCaptureDevice *torched=[AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];
[torched lockForConfiguration:nil];
[torched setTorchMode:YES];
[torched setFlashMode:YES];
[torched unlockForConfiguration];
Thanks!
I want to see what happens to my application if it is interrupted by a phone call or text message. Is there a way I can test this on the iPhone simulator?
It may not help in your situation (since it doesn't work in the simulator), but activating Siri works in a similar way to a phone call, sending your application to the background and interrupting audio, so is easier to test than making a call. Siri is on iPhone 4S and above, iPod touch 5th gen, and iPad 3 and above. Just hold down the home button if you have Siri enabled.
To expand on Lewis Gordon's answer it also works for devices without Siri. If you have voice control enabled then holding the home button down will interrupt audio and resign active.
Hardware -> Toggle In-Call Status will let you test the in-call UI.
I don't know of a way to test interruptions in the simulator, but as Lewis Gordon points out, you can bring up Siri on a device — even if there's no phone.
My application requires multi touch, so I was checking the documentation and could't find the property to require multi touch. Do all versions of iOS devices support multi touch or I am missing something?
Thanks in advance
There is no need to configure that. Every iOS device in existence (including the first-gen iPhone) supports multi-touch (unless its screen is defective). A pinch gesture, for example, is considered a multi-touch gesture, and is found in built-in apps like Maps and Mobile Safari.