检测快速双电源按钮 [英] Detect fast double power button press

查看:114
本文介绍了检测快速双电源按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以检测用户是否快速按下电源按钮两次? Apple使用这种方式确认在带有Face-ID的新iPhone X上购买Appstore。有没有可用的API?想要在类似的情况下使用它来通过Face-ID进行身份验证。

Is it possible to detect if the user pressed the power button two times fast? Apple use the way to confirm an Appstore purchase on the new iPhone X with Face-ID. Is there any API available? Want to use it in an similar case for authenticate via Face-ID.

推荐答案

没有。系统本身控制对侧面(睡眠/唤醒/电源)按钮的响应。

No. The system itself controls response to the side (sleep/wake/power) button.

iOS接受双击侧边按钮,仅在Apple介导的金融交易中提示进行面部身份验证 - 即从iTunes / App进行购买存储,包括应用内购买,或完成在线Apple Pay交易。在这种情况之外,双击侧边按钮会显示用于面对面Apple Pay交易的UI或(如果禁用双击显示钱包的设置)不执行任何操作。

iOS accepts a double-tap on side button to prompt for Face ID authentication only during an Apple-mediated financial transaction — that is, to make a purchase from iTunes / App Store, including in-app purchases, or to complete an online Apple Pay transaction. Outside such circumstances, double-tapping the side button either brings up the UI for an in-person Apple Pay transaction or (if the setting for showing Wallet on double-tap is disabled) does nothing.

欢迎您的应用提示进行面部识别/触摸ID身份验证以响应任何应用内或屏幕上的事件,但不仅没有明确的API来响应侧面按钮或其他硬件控制,出于这些原因重新利用现有API的任何尝试可能都不会超过 App Review

Your app is welcome to prompt for Face ID / Touch ID authentication in response to any in-app or on-screen event, but not only is there no API explicitly for responding to the side button or other hardware controls, any attempt to repurpose existing API for such reasons probably wouldn’t get past App Review:


2.5.9 改变或禁用标准交换机功能的应用程序,例如音量增大/减小和响铃/静音开关或其他本机用户界面元素或行为将被拒绝。

2.5.9 Apps that alter or disable the functions of standard switches, such as the Volume Up/Down and Ring/Silent switches, or other native user interface elements or behaviors will be rejected.

这篇关于检测快速双电源按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆