iOS打包被拒 ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more...

打包二进制文件的时候,被拒,收到下面邮件。

ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more APIs that access sensitive user data. The app's Info.plist file should contain a NSBluetoothPeripheralUsageDescription key with a user-facing purpose string explaining clearly and completely why your app needs the data. Starting Spring 2019, all apps submitted to the App Store that access user data are required to include a purpose string. If you're using external libraries or SDKs, they may reference APIs that require a purpose string. While your app might not use these APIs, a purpose string is still required. You can contact the developer of the library or SDK and request they release a version of their code that doesn't contain the APIs. Learn more (https://developer.apple.com/documentation/uikit/core_app/protecting_the_user_s_privacy).

大概意思是说,我使用了蓝牙模块,而未将NSBluetoothPeripheralUsageDescription key添加到info.plist,没有任何描述。

经过我仔细检查代码,发现项目里并没有用到蓝牙。
这是什么情况?

心灰意冷之时,偶然发现了一个获取权限的工具类。

+ (void)getBluetoothPermissions:(void(^)(BOOL authorized))completion {
   CBPeripheralManagerAuthorizationStatus authStatus = [CBPeripheralManager authorizationStatus];
   if (authStatus == CBPeripheralManagerAuthorizationStatusNotDetermined) {
    CBCentralManager *cbManager = [[CBCentralManager alloc] init];
        [cbManager scanForPeripheralsWithServices:nil options:nil];
   } else if (authStatus == CBPeripheralManagerAuthorizationStatusAuthorized) {
        if (completion) {
           completion(YES);
        }
    } else {
        completion(NO);
    }
}

上面代码是请求蓝牙权限的代码,虽然我没有调用,但是还是打包在了二进制文件里。

解决办法

注释任何你没有使用的请求权限的代码!!!
如果你使用了某项权限,请在info.plist里详细指明用途。
即使你没有调用,苹果在检查的时候也会检查出来。

注释了上面代码,打包上传,通过。

你可能感兴趣的:(iOS打包被拒 ITMS-90683: Missing Purpose String in Info.plist - Your app's code references one or more...)