we are unable to locate the App Tracking Transparency permission request when reviewed on iOS 15.0.2

App Store审核被拒内容如下:

Guideline 2.1 - Information Needed

We’re still 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 15.0.2

Since you indicated in App Store Connect that you collect data in order to track the user, we need to confirm that App Tracking Transparency has been correctly implemented.

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 your app does not track users, please update your app privacy information in App Store Connect. You must have the Account Holder or Admin role to update app privacy information.

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.

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 new requirements for apps that track users.Review developer documentation for App Tracking Transparency.

解决方案:

1、检查info.plist是否添加描述信息

NSUserTrackingUsageDescription
我们要使用隐私功能,内容详细一点比较好!

2、是否添加了申请权限的代码

申请权限代码(swift):


import AppTrackingTransparency

class WMPermissionRequest {
    
    //NEWLY ADDED PERMISSIONS FOR iOS 14
    static func requestIDFAPermission() {
        if #available(iOS 14, *) {
            #if DEBUG
            print("IDFA status = \(ATTrackingManager.trackingAuthorizationStatus)")
            #endif
            let status = ATTrackingManager.trackingAuthorizationStatus
            switch status {
            case .notDetermined:
                ATTrackingManager.requestTrackingAuthorization { status in
                    switch status {
                    case .authorized:
                        // Tracking authorization dialog was shown
                        // and we are authorized
                        print("Authorized")
                    case .denied:
                        // Tracking authorization dialog was
                        // shown and permission is denied
                        print("Denied")
                    case .notDetermined:
                        // Tracking authorization dialog has not been shown
                        print("Not Determined")
                    case .restricted:
                        print("Restricted")
                    @unknown default:
                        print("Unknown")
                    }
                }
            default:
                print("default")
            }


        }
    }
  

}

在合适的时候调用申请权限

func sceneDidBecomeActive(_ scene: UIScene)viewDidLoad()方法中均无法弹窗,但是在viewDidAppear确是有效的。代码如下:

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    
    //请求权限 ios 14.5
    WMPermissionRequest.requestIDFAPermission()
   
}

大家可以根据自己项目选择调用时机。

测试项目为新建简单的demo,目录如下:


在这里插入图片描述

demo下载地址 https:去/掉/url18中.ctfile文.com/f/1826018-518202008-2892d9(访问密码:7148)

你可能感兴趣的:(we are unable to locate the App Tracking Transparency permission request when reviewed on iOS 15.0.2)