// using System; // using UnityEngine; // // namespace GFGGame.Launcher // { // public class ATTAuth : MonoBehaviour // { // [System.Runtime.InteropServices.DllImport("__Internal")] // private static extern void _RequestTrackingAuthorizationWithCompletionHandler(); // // [System.Runtime.InteropServices.DllImport("__Internal")] // private static extern int _GetAppTrackingAuthorizationStatus(); // // private static Action getAuthorizationStatusAction; // // /// // /// 请求ATT授权窗口 // /// // /// // public static void RequestTrackingAuthorizationWithCompletionHandler(Action getResult) // { // //-1:"ios版本低于14" // //0: "ATT 授权状态待定"; // //1: "ATT 授权状态受限"; // //2: "ATT 已拒绝"; // //3: "ATT 已授权"; // Debug.Log("RequestTrackingAuthorizationWithCompletionHandler"); // getAuthorizationStatusAction = getResult; // _RequestTrackingAuthorizationWithCompletionHandler(); // } // // /// // /// 获取当前ATT授权状态 // /// // /// // public static int GetAppTrackingAuthorizationStatus() // { // return _GetAppTrackingAuthorizationStatus(); // } // // public void GetAuthorizationStatus(string status) // { // getAuthorizationStatusAction?.Invoke(int.Parse(status)); // } // // } // } //