当前位置:   article > 正文

Unity Mobile Notifications推送问题

Unity Mobile Notifications推送问题

1.在部分机型点击通知弹窗进不去游戏

把这里改成自己的Activity
在这里插入图片描述

2.推送的时候没有横幅跟icon红点

主要是第一句话 注册的时候选项可以选择
defaultNotificationChannel =
new AndroidNotificationChannel(“default_channel”, “Default Channel”, “For Generic notifications”,Importance.High);

        defaultNotificationChannel =
            new AndroidNotificationChannel("default_channel", "Default Channel", "For Generic notifications",Importance.High);

        AndroidNotificationCenter.RegisterNotificationChannel(defaultNotificationChannel);

        AndroidNotificationCenter.NotificationReceivedCallback receivedNotificationHandler = delegate (AndroidNotificationIntentData data)
        {
            var msg = "Notification received : " + data.Id + "\n";
            msg += "\n Notification received: ";
            msg += "\n .Title: " + data.Notification.Title;
            msg += "\n .Body: " + data.Notification.Text;
            msg += "\n .Channel: " + data.Channel;
            Debug.Log(msg);
        };

        AndroidNotificationCenter.OnNotificationReceived += receivedNotificationHandler;

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号