diff --git a/Runtime/GuruCore/Runtime/Firebase/FirebaseUtil.Message.cs b/Runtime/GuruCore/Runtime/Firebase/FirebaseUtil.Message.cs index 14d8f26..f2a3817 100644 --- a/Runtime/GuruCore/Runtime/Firebase/FirebaseUtil.Message.cs +++ b/Runtime/GuruCore/Runtime/Firebase/FirebaseUtil.Message.cs @@ -13,7 +13,7 @@ namespace Guru public static partial class FirebaseUtil { private static int _retryDeviceCount = 1; - private const int _retryTokenDelay = 2; + private const int _retryTokenDelay = 8; // public static bool? IsInitMessage; private static bool _isAutoFetchFcmToken = true; private static bool _isFetchOnce = false; @@ -52,6 +52,13 @@ namespace Guru /// private static void GetFCMTokenAsync() { + if (!NetworkUtil.IsNetAvailable) + { + // 无网络直接重新获取 + DelayGetFCMToken(_retryTokenDelay); + return; + } + Debug.Log($"{LOG_TAG}[SDK]--- Start GetTokenAsync ---"); FirebaseMessaging.GetTokenAsync().ContinueWithOnMainThread(task => {