From 447740487e21d3028bc85f1440d0491005e006d8 Mon Sep 17 00:00:00 2001 From: huyufei Date: Mon, 9 Sep 2024 16:05:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=20PushToken=20?= =?UTF-8?q?=E9=87=8D=E8=AF=95=E9=97=B4=E9=9A=94=E4=B8=BA=208s=EF=BC=8C=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A0=E7=BD=91=E7=BB=9C=E5=88=A4=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huyufei --- .../GuruCore/Runtime/Firebase/FirebaseUtil.Message.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 => {