美文网首页
ATTrackingManager.requestTrackin

ATTrackingManager.requestTrackin

作者: nick5683 | 来源:发表于2021-09-26 17:59 被阅读0次

    ATTrackingManager.requestTrackingAuthorization stopped working in iOS 15

    App Store被拒邮件

    相比最近好多人遇到IDFA的申请但是悲剧的情况,在百度上是搜不到任何关于这方面的信息的,全是iOS14.5,没有一个iOS15的,

    没办法,只好出去看看了

    Before it was working fine for iOS 14 and 14.5 and I didn't change anything.

    Got "NSUserTrackingUsageDescription" in the info.plist, added and imported the framework and added the following code in my AppDelegate:

    # -----   didFinishLaunchingWithOptions  -----

     if #available(iOS 14, *) {

    ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in

    // Tracking authorization completed. Start loading ads here.

    // loadAd()

    })

    } else {

    }

    # -----   在  didFinishLaunchingWithOptions 里面调用以上代码块还是会被拒的  -----

    因为苹果现在要让在  applicationDidBecomeActive 之后调用

    func sceneDidBecomeActive(_ scene: UIScene{

      DispatchQueue.main.asyncAfter(deadline: .now() + 1.0){

            if #available(iOS 14, *) {

                    ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in

                            // Tracking authorization  completed. Start loading ads here.

                            // loadAd()

                    })

            } else { }

        }

    }

    问题是,我在加载后的firstVC中请求的依然逃不过悲剧的下场,

    测试时候只能每次删除app来测试,一切正常,提交审核悲剧了,不知道苹果那边闹的什么鬼

    相关文章

      网友评论

          本文标题:ATTrackingManager.requestTrackin

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