iOS 14.5及以上如果加广告记得添加权限

2021-08-05  本文已影响0人  wenju

swift

func requestIDFA() {
        if #available(iOS 14.5, *) {
            ATTrackingManager.requestTrackingAuthorization(completionHandler: { status in
                debugPrint("\(status)")
                // Tracking authorization completed. Start loading ads here.
                // loadAd()
            })
        } else {
            // Fallback on earlier versions
        }
    
        //if #available(iOS 11.3, *) {
          //  SKAdNetwork.registerAppForAdNetworkAttribution()
        //} else {
            // Fallback on earlier versions
        //}
    }
上一篇下一篇

猜你喜欢

热点阅读