提交AppStore机器审核被拒以及解决方案 Missing Purpose String in Info.plist

作为iOS开发,我们都知道app的审核上架都要经过机审和人审,那么如果被坑到了机审,就会觉得自己怎么可能会导致不久卡到?作这么久的开发,机审这些硬性的要求竟然还有自己不知道的?哈哈。

其实追其原因,都是一些马虎大意造成的。又或者是一些三方库内部使用的为对外开放。“坑”了你。

那么硬性要求大家遇到最多的就是权限问题:(尤其最近安卓机某些app频发的随意访问你的通讯录,相册,摄像头等,国家也开始对app的监管,苹果这边本来做的还可以,现在也更严格了)

下面就是一封提交被机审拒掉的邮件:

Dear Developer,

We identified one or more issues with a recent delivery for your app, “APP名称” 1.0.0 (1.0.0.6). Please correct the following issues, then upload again.

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 NSContactsUsageDescription 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).

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 NSCalendarsUsageDescription 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).

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 NSAppleMusicUsageDescription 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).

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 NSMotionUsageDescription 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).

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 NSSpeechRecognitionUsageDescription 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).

Though you are not required to fix the following issues, we wanted to make you aware of them:

ITMS-90078: Missing Push Notification Entitlement - Your app appears to register with the Apple Push Notification service, but the app signature’s entitlements do not include the ‘aps-environment’ entitlement. If your app uses the Apple Push Notification service, make sure your App ID is enabled for Push Notification in the Provisioning Portal, and resubmit after signing your app with a Distribution provisioning profile that includes the ‘aps-environment’ entitlement. Xcode does not automatically copy the aps-environment entitlement from provisioning profiles at build time. This behavior is intentional. To use this entitlement, either enable Push Notifications in the project editor’s Capabilities pane, or manually add the entitlement to your entitlements file. For more information, see https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/HandlingRemoteNotifications.html#//apple_ref/doc/uid/TP40008194-CH6-SW1.

Best regards,

The App Store Team

原因就是机审检测到你的info.plist文件没有对通讯录、日历、媒体库、运动轨迹、语音识别这几个字段没有相应的描述,但是项目里面有使用相关的代码。(不要怀疑他们是怎么查出来你是用了的,毕竟语言是他们自己开发出来的,其实你自己也可以搜索:可以参考我之前的另一篇文章《关于私有api审核被拒问题解决方案》

解决方案:

1.那么我们就需要给这些权限添加上描述,目前iOS审核比较严格描述也要写详细一些,要写上用这些事做什么的,不能和之前一样随便一些就好了。权限这个东西每次都会查的,不要心存侥幸随便一写这次过了后面就不管了,说不好哪一次提交版本迭代还是会被打回的。

2.找出相应的三方插件,如果不使用的话就删除,或者更新到最新的版本(一般的三方都会及时更新掉的)。

3.或者及时查看相关使用三方库的说明提醒,规避方案等方法。

过程中有小伙伴用到了flutter开发。

这里就说一下flutter开发常用的插件:permission_handler获取权限的插件, 此插件包含相机、相册、通讯录、定位等权限,如果项目中没有使用某些权限,但是只要引入了插件就会被打包到ipa中,如果info.plist中没有加入相关的权限key就会被机器审核查出, 从而给你发送这个邮件.

好多开发都只关注了怎么用。其实他在介绍readme里面最开始的地方就有两个收起来的小结:

里面就有介绍了iOS的注意事项说到了权限的信息:

告知如果不使用的权限在podfile文件里面加上 config.build_settings[‘GCC_PREPROCESSOR_DEFINITIONS’] ||= []
数组里面定义无需使用的权限, 然后pod install执行一下(必须执行, 否则不生效),或者你可以重新flutter编译项目也可以, 然后再次打包提交就没问题了。

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [
              '$(inherited)',
              ## dart: PermissionGroup.calendar
               'PERMISSION_EVENTS=0',

              ## dart: PermissionGroup.contacts
               'PERMISSION_CONTACTS=0',

              ## dart: PermissionGroup.mediaLibrary
               'PERMISSION_MEDIA_LIBRARY=0',

              ## dart: PermissionGroup.sensors
               'PERMISSION_SENSORS=0'

            ]

    end
  end
end

具体的iOS的Privety对应关系可以点进Permission去查看他的几个枚举值的注视对应安卓和iOS的相应名称字段。

最后:

所有机审遇到的问题都是小问题,主要是怎么去找(我上面有提到一些特殊的私有API查找方式,可借鉴),找到之后就好办了。

猜你喜欢

转载自blog.csdn.net/BUG_delete/article/details/114759583