Can Siri be disabled within an app?

2020-07-02 09:45发布

问题:

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?

回答1:

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



回答2:

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.