在iOS 15正式版發(fā)布后,App提交審核后多次遇到次問題,如何解決?
這里記錄下解決過程
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 15.0.
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.
在iOS15 斷點(diǎn)調(diào)試,發(fā)現(xiàn)在回調(diào)時(shí)候 ATTrackingManagerAuthorizationStatus 還是 ATTrackingManagerAuthorizationStatusNotDetermined
最開始嘗試多次調(diào)用此方法,發(fā)現(xiàn)居然可以彈出idfa彈窗了!
if (@available(iOS 14,*)) {
[ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
//
}];
}
蘋果在Xcode 13 上官方文檔已經(jīng)進(jìn)行了更新,以下是蘋果官方文檔說明
Calls to the API only prompt when the application state is: UIApplicationStateActive. Calls to the API through an app extension do not prompt.
The requestTrackingAuthorizationWithCompletionHandler: is the one-time request to authorize or deny access to app-related data that can be used for tracking the user or the device. The system remembers the user’s choice and doesn’t prompt again unless a user uninstalls and then reinstalls the app on the device.
調(diào)用邏輯
- (void)applicationDidBecomeActive:(UIApplication *)application {
// 申請(qǐng)權(quán)限代碼 requestAppTrackAuth ;
}
然后經(jīng)過一段時(shí)間發(fā)現(xiàn)大部分情況,將權(quán)限申請(qǐng)放在 ```applicationDidBecomeActive 調(diào)用可以通過審核
其他小概率不通過的,可以嘗試下玄學(xué)延時(shí)方法 或者 進(jìn)行狀態(tài)循環(huán)檢測(cè)