update: 更新打点和消息 channel 配置

Signed-off-by: huyufei <yufei.hu@castbox.fm>
胡宇飞 2024-09-05 21:08:24 +08:00
parent 727da50625
commit 69cf28f766
2 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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