diff --git a/Runtime/Code/SDK/GuruSDK.Ads.cs b/Runtime/Code/SDK/GuruSDK.Ads.cs index 31bd983..ee3bd3c 100644 --- a/Runtime/Code/SDK/GuruSDK.Ads.cs +++ b/Runtime/Code/SDK/GuruSDK.Ads.cs @@ -264,6 +264,7 @@ namespace Guru UnityEngine.Debug.Log($"[SDK] ---- Check Noti Permission: {isGranted}"); if (isGranted) { + UnityEngine.Debug.Log($"[SDK] ---- Set Notification Permission: {status}"); SetNotiPerm(status); return; } @@ -280,12 +281,30 @@ namespace Guru UnityEngine.Debug.Log($"[SDK] ---- RequestNotificationPermission"); NotificationService.RequestPermission(status => { - UnityEngine.Debug.Log($"[SDK] ---- Get Notification Permission: {status}"); - SetNotiPerm(status); + UnityEngine.Debug.Log($"[SDK] ---- Set Notification Permission: {status}"); + if(!string.IsNullOrEmpty(status)) SetNotiPerm(status); + callback?.Invoke(status); }); } - + + /// + /// 获取 Notification 状态值 + /// + /// + public static string GetNotificationStatus() + { + return NotificationService.GetStatus(); + } + + /// + /// 用户是否已经获取了 Notification 授权了 + /// + /// + public static bool IsNotificationPermissionGranted() + { + return NotificationService.IsPermissionGranted(); + } #endregion