using System; using System.Threading.Tasks; using UnityEngine; namespace tysdk { public partial class TYSdkFacade { /*================================================ _ _____ _____ / \|_ _|_ _| / _ \ | | | | / ___ \| | | | /_/ \_\_| |_| =================================================*/ public bool IsAttAccepted() { return UnityBridgeFunc.GetATT() == 1; } public async Task RequestATT() { #if UNITY_EDITOR || UNITY_ANDROID await Task.Yield(); return new ATTInfo() { isAccepted = true }; #elif UNITY_IOS var task = TYSDKCallbackManager.Instance.RegisterCallback(); UnityBridgeFunc.RequestATT(); try { return await task; } catch (Exception e) { Debug.LogWarning(e.Message); return new ATTInfo() { isAccepted = false }; } #endif } public void RequestATTResult(string r) { TYSDKCallbackManager.Instance.TryTriggerCallback(new ATTInfo() { isAccepted = r == "1" }); } } }