我的应用程序(运行在iPhone X模拟器Xcode 9.0.1中)要求我允许我使用Face。
警报说:
Do you want to allow <appName> to use Face ID? This app was designed to use Touch ID and may not fully support Face ID.
我原以为,我对LocalAuthentication框架中的新API(例如biometryType)所做的几处更改基本上都适用于Face。
为了使我的应用程序完全支持脸ID,我还需要做些什么吗?
当打印iPhone 6+模拟器的屏幕高度时,我得到了2208,正如预期的那样。然而,当我在一个实际的iPhone 6+上测试时,我得到了1920。对哪一个是正确的感到非常困惑。下面是我使用的代码:
func test() {
if UIDevice().userInterfaceIdiom == .phone {
switch UIScreen.main.nativeBounds.height {
case 1136:
print("iPhone 5 or 5S or 5C")
case 1334:
我在应用商店上的应用程序正在访问iPhone联系人,用户在iOS 6上下载它后,它无法访问iPhone联系人,而它在iOS 5上运行正常。问题是苹果在iOS 6中设置了新的隐私设置。因此,在搜索之后,我发现我必须在代码中执行以下操作才能访问用户联系人:
//in order to test addressbook availability we have to attempt to create an addressbook instance using ABAddressBookCreateWithOptions
#if __IPHONE_OS_VERSION_MAX_ALLOWED