zoukankan      html  css  js  c++  java
  • iOS10之Expected App Behaviors

      昨天上架到appStore的时候碰到个问题,构建好后上传到itunesconnect的的包都用不了,

    显示错误为:此构建版本无效。  

    或者英文显示为:ITC.apps.preReleaseBuild.errors.invalidBinary

    由于和itunesconnect帐号绑定的邮箱暂时进不去,没看到apple发到我们邮箱的通知信息,所以只在度娘搜索:有的说

    是网络问题,有说是电脑问题,有说是icon问题,有说使用Application Loader上传.....  

    但是试了都没解决问题,然后就出现了这么多个『此构建版本无效』

    后面终于登录了邮箱,看打了apple那边的团队发过来的通知邮件,原来是这个原因:

    ......
    This app attempts to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSBluetoothPeripheralUsageDescription key with a string value explaining to the user how the app uses this data. Once these issues have been corrected, you can then redeliver the corrected binary. Regards, The App Store team

    意思是app的配置文件info.plist少了一个app请求使用设备蓝牙的请求配置:NSBluetoothPeripheralUsageDescription

    然后加上后,再次打包上传就可以使用了!

    查了下资料,apple从iOS10之后,Expected App Behaviors(预期应用行为),对于用户的隐私更加重视,如果需要访问用户手机的相机、多媒体、蓝牙、通讯录、位置、健康、运动...等等,必须询问用户征得用户授权才可以使用。

    官方说明链接:

    https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/ExpectedAppBehaviors/ExpectedAppBehaviors.html

    在项目工程配置文件info.plist添加时会自动提示的,截图如下:

    查看info.plist的source code,展开如下:

    <key>NSBluetoothPeripheralUsageDescription</key>
        <string>是否允许此App访问您的蓝牙</string>
        <key>NSCalendarsUsageDescription</key>
        <string>是否允许此App访问您的日历</string>
        <key>NSCameraUsageDescription</key>
        <string>是否允许此App使用您的相机</string>
        <key>NSContactsUsageDescription</key>
        <string>是否允许此App访问您的通讯录</string>
        <key>NSHealthShareUsageDescription</key>
        <string>是否允许此App访问您的健康分享</string>
        <key>NSHealthUpdateUsageDescription</key>
        <string>是否允许此App访问您的健康更新</string>
        <key>NSHomeKitUsageDescription</key>
        <string>是否允许此App访问您的HomeKit</string>
        <key>NSLocationAlwaysUsageDescription</key>
        <string>我们需要通过您的地理位置信息获取您周边的相关数据</string>
        <key>NSLocationWhenInUseUsageDescription</key>
        <string>您的位置信息将用于地图上显示您的位置,并发送给联系人</string>
        <key>NSMicrophoneUsageDescription</key>
        <string>是否允许此App使用您的麦克风</string>
        <key>NSMotionUsageDescription</key>
        <string>App需要您的同意,才能访问运动与健身</string>
        <key>kTCCServiceMediaLibrary</key>
        <string>是否允许此App访问您的音乐</string>
        <key>NSPhotoLibraryUsageDescription</key>
        <string>是否允许此App访问您的媒体资料库</string>
        <key>NSRemindersUsageDescription</key>
        <string>是否允许此App访问您的提醒事项</string>
        <key>NSSiriUsageDescription</key>
        <string>是否允许此App访问您的Siri</string>
        <key>NSSpeechRecognitionUsageDescription</key>
        <string>是否允许此App使用您的语音识别</string>
        <key>NSVideoSubscriberAccountUsageDescription</key>
        <string>是否允许此App访问您的tv供应商账户</string>

    原文链接:http://www.cnblogs.com/tandaxia/p/6207236.html

  • 相关阅读:
    【转】Visual Studio 2008中使用科学计算库GSL
    【转】[Python Tip]如何在Windows下方便地进入命令行运行程序
    【转】URL Encoding (URL转义字符)
    RDLC报表,纯文字内容,动态数据源 解决方案
    C# 数值计算
    标准库List使用注意
    VS2008 运行出现 “无法启动该程序 计算机中丢失 MSVCR90D.dll”
    数据结构在游戏中的简单应用(转)
    SQL SERVER 2005 四种排序函数
    2010.11.30
  • 原文地址:https://www.cnblogs.com/tandaxia/p/6207236.html
Copyright © 2011-2022 走看看