diff --git a/Runtime/GuruNoification/Manager/NotificationAgentAndroid.cs b/Runtime/GuruNoification/Manager/NotificationAgentAndroid.cs index 51c3cff..6830f7d 100644 --- a/Runtime/GuruNoification/Manager/NotificationAgentAndroid.cs +++ b/Runtime/GuruNoification/Manager/NotificationAgentAndroid.cs @@ -12,7 +12,7 @@ namespace Guru.Notification public const string FCM_DEFAULT_CHANNEL_ID = "fcm_default_channel"; private const string STATUS_GRANTED = "granted"; private const string STATUS_DENIDED = "denied"; - private const string STATUS_NOT_DETERMINED = "not_determined"; + // private const string STATUS_NOT_DETERMINED = "not_determined"; private const int REQUEST_PERMISSION_SDK_VERSION = 33; private const string PERMISSION_POST_NOTIFICATION = "android.permission.POST_NOTIFICATIONS"; diff --git a/Runtime/GuruNoification/Manager/NotificationService.cs b/Runtime/GuruNoification/Manager/NotificationService.cs index 52d1e45..4bc0b07 100644 --- a/Runtime/GuruNoification/Manager/NotificationService.cs +++ b/Runtime/GuruNoification/Manager/NotificationService.cs @@ -77,6 +77,7 @@ namespace Guru.Notification Agent.RequestPermission(callback); return; } + Debug.LogError($"[SDK][Noti] --- Agent is missing, return default status: {DEFAULT_USER_STATUS}"); callback?.Invoke(DEFAULT_USER_STATUS); } @@ -87,7 +88,12 @@ namespace Guru.Notification public static string GetStatus() { - return Agent?.GetStatus() ?? DEFAULT_USER_STATUS; + if(!_initOnce) Initialize(); + + if(Agent != null) return Agent.GetStatus(); + + Debug.LogError($"[SDK][Noti] --- Agent is missing, return default status: {DEFAULT_USER_STATUS}"); + return DEFAULT_USER_STATUS; } #endregion