From 69cf28f766c38bc4b532d39d37277a365a5a7c97 Mon Sep 17 00:00:00 2001 From: huyufei Date: Thu, 5 Sep 2024 21:08:24 +0800 Subject: [PATCH] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0=E6=89=93=E7=82=B9?= =?UTF-8?q?=E5=92=8C=E6=B6=88=E6=81=AF=20channel=20=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: huyufei --- Runtime/GuruCore/Runtime/Firebase/FirebaseUtil.Message.cs | 4 +++- .../GuruNoification/Manager/NotificationAgentAndroid.cs | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Runtime/GuruCore/Runtime/Firebase/FirebaseUtil.Message.cs b/Runtime/GuruCore/Runtime/Firebase/FirebaseUtil.Message.cs index fa4b30b..31ef01f 100644 --- a/Runtime/GuruCore/Runtime/Firebase/FirebaseUtil.Message.cs +++ b/Runtime/GuruCore/Runtime/Firebase/FirebaseUtil.Message.cs @@ -142,13 +142,15 @@ namespace Guru private static void OnTokenReceived(object sender, TokenReceivedEventArgs token) { + Debug.Log($"{LOG_TAG} --- OnTokenReceived:{token.Token}"); #if UNITY_IOS DeviceUtil.SetiOSBadge(); #endif } - public static void OnMessageReceived(object sender, MessageReceivedEventArgs e) + public static void OnMessageReceived(object sender, MessageReceivedEventArgs args) { + Debug.Log($"{LOG_TAG} --- OnMessageReceived:{args.Message}"); #if UNITY_IOS DeviceUtil.SetiOSBadge(); #endif diff --git a/Runtime/GuruNoification/Manager/NotificationAgentAndroid.cs b/Runtime/GuruNoification/Manager/NotificationAgentAndroid.cs index 6953527..6186c98 100644 --- a/Runtime/GuruNoification/Manager/NotificationAgentAndroid.cs +++ b/Runtime/GuruNoification/Manager/NotificationAgentAndroid.cs @@ -11,6 +11,7 @@ namespace Guru.Notification { private const string FCM_DEFAULT_CHANNEL_NAME = "fcm_default_channel"; private const string FCM_DEFAULT_CHANNEL_ID = "default_notification_channel_id"; + private const string FCM_DEFAULT_CHANNEL_DESC = "Default cloud messaging channel"; private const string STATUS_GRANTED = "granted"; private const string STATUS_DENIDED = "denied"; // private const string STATUS_NOT_DETERMINED = "not_determined"; @@ -160,8 +161,11 @@ namespace Guru.Notification { // 低版本处理方式 Debug.Log($"[SDK][Noti] --- #2 SDK {sdkInt} not requested -> open channel"); - AndroidNotificationCenter.RegisterNotificationChannel(new AndroidNotificationChannel(FCM_DEFAULT_CHANNEL_ID, - FCM_DEFAULT_CHANNEL_NAME, "", Importance.Default)); // 打开ChannelID + AndroidNotificationCenter.RegisterNotificationChannel(new AndroidNotificationChannel( + FCM_DEFAULT_CHANNEL_ID, + FCM_DEFAULT_CHANNEL_NAME, + FCM_DEFAULT_CHANNEL_DESC, + Importance.Default)); // 打开ChannelID SetGrantStatus(STATUS_GRANTED); } else