美文网首页
iOS15系统App Tracking Transparency

iOS15系统App Tracking Transparency

作者: 花卷爱吃草 | 来源:发表于2022-03-20 19:09 被阅读0次

    iOS提审被拒,苹果的回复是

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

    其实回复很明显,说是在iOS15.4上没有弹出广告授权弹窗,但是我们项目在info.plist文件已经配了NSUserTrackingUsageDescription了,但是仍然被拒。
    经过真机调试发现我们的授权弹窗在APP第二次启动才弹出授权弹窗,第一次启动只弹了通知授权弹窗。后来查了一下资料,网上很多文章都没说到点子上,所以我这描述一下。
    唤起弹窗需要调用下面这个方法,但是有个前提:需要APP在激活状态下才能唤起弹窗:

    [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) { }];
    
    image.png

    详见苹果官方文档https://developer.apple.com/documentation/apptrackingtransparency/attrackingmanager/3547037-requesttrackingauthorization
    因为我们项目启动的时候,通知授权弹窗先弹起来,会使APP进入非激活态,这个时候再唤起IDFA弹窗,就弹不出来了。而第二次启动APP的时候,通知授权的弹窗已经弹过,不会使APP进入非激活态,所以第二次启动APP能正常弹出授权弹窗。因此APP启动的时候如果有多个授权弹窗,要单独处理IDFA的授权弹窗唤起。需要等APP激活后再调用这个方法
    一般推荐在

    - (void)applicationDidBecomeActive:(UIApplication*)application
    

    这个方法中调用。如果你业务需要在使用到的时候再调用,那么需要判断一下APP是否是激活态,是的话就直接调用,不是的话需要做个标记,等收到激活通知后再调用。如:

    if UIApplication.shared.applicationState == .active {
                requstIdfaWithoutCheck(successHandler: successHandler)
            } else {
                self.idfaRequestBlock = successHandler
            }
    

    相关文章

      网友评论

          本文标题:iOS15系统App Tracking Transparency

          本文链接:https://www.haomeiwen.com/subject/kqdadrtx.html