update: 更新打点和消息 channel 配置
Signed-off-by: huyufei <yufei.hu@castbox.fm>
parent
727da50625
commit
69cf28f766
|
|
@ -142,13 +142,15 @@ namespace Guru
|
||||||
|
|
||||||
private static void OnTokenReceived(object sender, TokenReceivedEventArgs token)
|
private static void OnTokenReceived(object sender, TokenReceivedEventArgs token)
|
||||||
{
|
{
|
||||||
|
Debug.Log($"{LOG_TAG} --- OnTokenReceived:{token.Token}");
|
||||||
#if UNITY_IOS
|
#if UNITY_IOS
|
||||||
DeviceUtil.SetiOSBadge();
|
DeviceUtil.SetiOSBadge();
|
||||||
#endif
|
#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
|
#if UNITY_IOS
|
||||||
DeviceUtil.SetiOSBadge();
|
DeviceUtil.SetiOSBadge();
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ namespace Guru.Notification
|
||||||
{
|
{
|
||||||
private const string FCM_DEFAULT_CHANNEL_NAME = "fcm_default_channel";
|
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_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_GRANTED = "granted";
|
||||||
private const string STATUS_DENIDED = "denied";
|
private const string STATUS_DENIDED = "denied";
|
||||||
// private const string STATUS_NOT_DETERMINED = "not_determined";
|
// 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");
|
Debug.Log($"[SDK][Noti] --- #2 SDK {sdkInt} not requested -> open channel");
|
||||||
AndroidNotificationCenter.RegisterNotificationChannel(new AndroidNotificationChannel(FCM_DEFAULT_CHANNEL_ID,
|
AndroidNotificationCenter.RegisterNotificationChannel(new AndroidNotificationChannel(
|
||||||
FCM_DEFAULT_CHANNEL_NAME, "", Importance.Default)); // 打开ChannelID
|
FCM_DEFAULT_CHANNEL_ID,
|
||||||
|
FCM_DEFAULT_CHANNEL_NAME,
|
||||||
|
FCM_DEFAULT_CHANNEL_DESC,
|
||||||
|
Importance.Default)); // 打开ChannelID
|
||||||
SetGrantStatus(STATUS_GRANTED);
|
SetGrantStatus(STATUS_GRANTED);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue