上架AppStroe 遇到ATT问题
概述
12年9月份iOS6发布,IDFA面世,主要用于给开发者跟踪应用中广告的投放效果,但很多应用(或三方SDK)会获取IDFA作为设备唯一标识使用。 iOS14.5 发布之后,苹果要求应用获取 IDFA 时,需弹出用户许可收集跟踪数据的授权框,如果没有弹出授权框则可能会被App Store审核拒绝,提示违反5.1.2规则:
如何判断是否需要开启广告标识(IDFA)?*
如果您的应用使用了uni-AD 或 依赖三方SDK的功能模块(包含:新浪微博登录和分享、一键登录、友盟统计),这些SDK内会触发获取IDFA,所以打包时需要勾选开启 IDFA 标识。 一些uni原生插件也可能会读取IDFA,因此碰到App Store审核不通过,提示违反5.1.2规则且内容中包含App Tracking Transparency都可以通过配置开启广告标识(IDFA)解决。
注:对于非广告类的三方SDK,我们会密切关注其官方的版本更新,待官方出了不包含IDFA的版本我们会尽快适配升级 自从IOS版本升级到14.5后 苹果官方要求所有应用都必须要有ATT才能上架 面是XCode 代码
OC代码
#import <AppTrackingTransparency/AppTrackingTransparency.h>
#import <AdSupport/ASIdentifierManager.h>
void RequestIDFA()
{
if (@available(iOS 14, *)) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
if (status == ATTrackingManagerAuthorizationStatusAuthorized) {
NSString *idfa = [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];
NSLog(@"获取到了%@",idfa);
} else {
NSLog(@"请在设置-隐私-跟踪中允许App请求跟踪");
}
}];
} else {
if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {
NSString *idfa = [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];
NSLog(@"获取到了%@",idfa);
} else {
NSLog(@"请在设置-隐私-广告中打开广告跟踪功能");
}
}
}
C#代码
using System.Runtime.InteropServices;
void Start()
{
#if UNITY_IOS
RequestIDFA();
#endif
}
#if UNITY_IOS
[DllImport("__Internal")]
private static extern void RequestIDFA();
#endif
Info 中需要添加对玩家的说明
NSUserTrackingUsageDescription Your data will be used to measure advertising efficiency.
####### 提示在测试该App 的ATT功能是否生效时,一定要检查你的设备的跟踪是否开启,必须开启才能调到 ####### 
关于商店中的配置
配置开启广告标识(IDFA)
在 manifest.json 文件的 “App常用其它设置” 中可勾选开启(注意HBuilder X 2.4以上为默认勾选),需提交云端打包才会生效 
配置 NSUserTrackingUsageDescription 隐私描述
开启广告标识(IDFA)后,云端打包默认隐私描述为“请放心,开启权限不会获取您在其他站点的隐私信息,该权限仅用于标识设备并保障服务安全与提示浏览体验”,也可以在 manifest.json 文件的 “App权限配置” 项的“iOS隐私信息访问的许可描述”下配置 NSUserTrackingUsageDescription 隐私描述:
注:使用低版本HBuilderX时可以切换到manifest.json的源码视图,手动在"privacyDescription"节点下添加 NSUserTrackingUsageDescription 字段配置隐私描述。
隐私描述是为了告诉用户,应用为什么要跟踪用户及访问设备的IDFA,配置的描述内容会展示在授权框上,参考以下建议描述说明:
包含uni-AD功能时填写: 请放心,开启权限不会获取您在其他站点的隐私信息,该权限仅用于标识设备、第三方广告、并保障服务安全与提示浏览体验 不包含uni-AD功能时填写:请放心,开启权限不会获取您在其他站点的隐私信息,该权限仅用于标识设备并保障服务安全与提示浏览体验 运行时弹出授权提示框显示效果如下:
配置 “App 隐私”
开启广告标识(IDFA)后,提交App Store审核之前,需要在App Store Connect 配置 “App 隐私”。 首先点击编辑“数据类型”,勾选 “是,我们会从此App收集数据” 选项;然后点下一步, 
因为uni框架会收集崩溃数据,所以需要勾选列表中的“崩溃数据”选项,另外再勾选“设备 ID”选项; 如果您使用了uni-AD,则勾选“广告数据”选项,如果没有,则不勾选; 如下图所示,然后发布。  注意:编辑“数据类型”时,需根据自己应用使用到的数据,灵活勾选;比如使用了定位,则勾选定位相关的选项 再编辑“设备 ID” (如使用了uni-AD则再勾选“第三方广告”选项) 编辑“崩溃数据” 编辑“广告数据”(如果上一步勾选了) 完成界面 
注意事项
配置NSUserTrackingUsageDescription仍然审核不通过,提示违反5.1.1规则: 如果配置了开启广告标识(IDFA)并且也配置了 NSUserTrackingUsageDescription隐私描述,但是应用还是被App Stroe审核拒绝,且提示违反5.1.1规则: `Guideline 5.1.1 - Legal - Privacy - Data Collection and Storage
We noticed that your app requests the user’s consent to access the AppTrackingTransparency framework, but doesn’t sufficiently explain the use of the AppTrackingTransparency framework in the purpose string.
To help users make informed decisions about how their data is used, all permission request alerts need to specify how your app will use the requested information.
Next Steps
Please revise the relevant purpose string in your app’s Info.plist file to specify why your app needs access to the user’s AppTrackingTransparency framework.
You can modify your app’s Info.plist file using the property list editor in Xcode.
Resources
- See example of helpful, informative purpose strings.
- Review a list of relevant property list keys.`
则可能是描述内容过于简单,没有准确说明应用为什么要跟踪用户及访问设备的IDFA,可参考上文的建议更新NSUserTrackingUsageDescription描述内容
配置NSUserTrackingUsageDescription仍然审核不通过,提示违反2.1规则:
`Guideline 2.1 - Information Needed
We’re looking forward to completing the review of your app, but we need more information to continue. Specifically, we noticed that your app uses the AppTrackingTransparency framework, but we haven’t been able to locate the App Tracking Transparency permission request.
Next Steps
Please indicate where in your app we can find the AppTrackingTransparency permission request. The request should appear before any data is collected that could be used to track the user.
Apps that track user’s activity must implement App Tracking Transparency and request permission before collecting data used to track.
Resources
See Frequently Asked Questions about the new requirements for apps that track users.
Since your App Store Connect status is Metadata Rejected, we do NOT require a new binary. To revise the metadata, visit App Store Connect to select your app and revise the desired metadata values. Once you’ve completed all changes, reply to this message in Resolution Center and we will continue the review.`
配置NSUserTrackingUsageDescription后真机运行不弹出授权提示框
如果按照上述描述勾选了IDFA 和配置了NSUserTrackingUsageDescription隐私描述,但是真机运行App启动时没有弹出授权提示框,可能的原因是,手机的系统版本是iOS14以下的,或者是iOS14.5的手机,但是手机“设置-隐私-跟踪”里,系统默认将“跟踪选项”关闭了且灰色不可设置;目前这种情况还不确定是iOS的bug,还是是针对地区特殊对待,解决办法:可以将账号切换成一个美区的,这时“跟踪选项”是可以操作的;或者将手机设置还原成默认设置,这时App启动时也能弹出授权提示框,但只会弹出一次。
|