QDAppStoreManagerInit.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // using UnityEngine;
  2. // using UniFramework.Event;
  3. //
  4. // namespace GFGGame.Launcher
  5. // {
  6. //
  7. // public static class QDAppStoreManagerInit
  8. // {
  9. // public static int AppTrackingAuthorizationStatus;
  10. // private const string ATTStatusLocalKey = "ATTStatusLocalKey";
  11. //
  12. // public static void InitPlatform()
  13. // {
  14. // #if !UNITY_EDITOR && UNITY_IOS
  15. // AppTrackingAuthorizationStatus = ATTAuth.GetAppTrackingAuthorizationStatus();
  16. // if (AppTrackingAuthorizationStatus == 0)
  17. // {
  18. // bool requested = LocalCache.GetBool(ATTStatusLocalKey, false);
  19. // if(!requested)
  20. // {
  21. // AddIOSMethod();
  22. // ATTAuth.RequestTrackingAuthorizationWithCompletionHandler((status) =>
  23. // {
  24. // Debug.Log("ATT status :" + status);
  25. // AppTrackingAuthorizationStatus = status;
  26. // });
  27. // }
  28. // }
  29. // #endif
  30. // UniEvent.SendMessage(new LauncherEvent.InitPlatformResult() { success = true});
  31. // }
  32. //
  33. //
  34. // private static void AddIOSMethod()
  35. // {
  36. // string objName = "IOSMethod";
  37. // var obj = GameObject.Find(objName);
  38. // if(obj == null)
  39. // {
  40. // obj = new GameObject(objName);
  41. // GameObject.DontDestroyOnLoad(obj);
  42. // }
  43. // obj.AddComponent<ATTAuth>();
  44. // }
  45. // }
  46. // }