iOS 17.2系统获取IDFA时不弹窗问题

iOS 17.2系统获取IDFA时不弹窗问题

问题:

最近公司接入三方广告归因SDK,要求使用IDFA

代码:

info.plist文件添加跟踪权限请求描述文字

NSUserTrackingUsageDescription

此标识符将用于向您推荐个性化广告。

导入框架

#import

#import

获取广告标识

- (void)applicationDidBecomeActive:(UIApplication *)application {

if (@available(iOS 14, *)) {

// iOS14及以上版本需要先请求权限

[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {

// 获取到权限后,依然使用老方法获取idfa

if (status == ATTrackingManagerAuthorizationStatusAuthorized) {

NSString *idfa = [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];

NSLog(@"%@",idfa);

} else {

NSLog(@"请在设置-隐私-跟踪中允许App请求跟踪");

}

}];

} else {

// iOS14以下版本依然使用老方法

// 判断在设置-隐私里用户是否打开了广告跟踪

if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {

NSString *idfa = [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];

NSLog(@"%@",idfa);

} else {

NSLog(@"请在设置-隐私-广告中打开广告跟踪功能");

}

}

}

审核被驳回,驳回信息:

Hello,

The issues we previously identified still need your attention.

Guideline 2.1 - Information Needed

We're looking forward to completing our review, but we need more information to continue.

Your app uses the AppTrackingTransparency framework, but we are unable to locate the App Tracking Transparency permission request when reviewed on iOS 17.2.

Next Steps

Please explain where we can find the App Tracking Transparency permission request in your app. The request should appear before any data is collected that could be used to track the user.

If you've implemented App Tracking Transparency but the permission request is not appearing on devices running the latest OS, please review the available documentation and confirm App Tracking Transparency has been correctly implemented.

If your app does not track users, update your app privacy information in App Store Connect to not declare tracking. You must have the Account Holder or Admin role to update app privacy information.

Resources

- Tracking is linking data collected from your app with third-party data for advertising purposes, or sharing the collected data with a data broker. Learn more about tracking.

- See Frequently Asked Questions about the requirements for apps that track users.

- Review developer documentation for App Tracking Transparency.

解决:

iOS14及以上版本请求权限时需要加个延迟,代码如下:

if (@available(iOS 14, *)) {

// iOS14及以上版本需要先请求权限

dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{

[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {

// 获取到权限后,依然使用老方法获取idfa

if (status == ATTrackingManagerAuthorizationStatusAuthorized) {

NSString *idfa = [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];

NSLog(@"idfa = %@",idfa);

} else {

NSLog(@"请在设置-隐私-跟踪中允许App请求跟踪");

}

}];

});

} else {

// iOS14以下版本依然使用老方法

// 判断在设置-隐私里用户是否打开了广告跟踪

if ([[ASIdentifierManager sharedManager] isAdvertisingTrackingEnabled]) {

NSString *idfa = [[ASIdentifierManager sharedManager].advertisingIdentifier UUIDString];

NSLog(@"idfa = %@",idfa);

} else {

NSLog(@"请在设置-隐私-广告中打开广告跟踪功能");

}

}

相关推荐

王者16岁游戏时长
战争沙盘游戏有哪些
btbt365me

战争沙盘游戏有哪些

📅 09-15 👁️ 9795
女人第一眼看這裡!男人最性感魅力的8個身體部位
火线、地线与零线_火线零线地线怎么接?火线
停在划线区被罚,放在马路上却不罚,哈罗单车的“禁停区”到底怎么定的?
国外常规潜艇AIP系统技术发展调研报告
伯乐头条
365bet手机客户端下载

伯乐头条

📅 08-03 👁️ 6562
加班控制技巧全解析,加班真的无法避免吗?
《王者荣耀》体验服活跃机制介绍