代码之家  ›  专栏  ›  技术社区  ›  Oleg Sokolov

firebase前台推送消息具有无法访问的通知

  •  0
  • Oleg Sokolov  · 技术社区  · 7 年前

    我们有一个扩展的 FirebaseMassageingService 以下内容:

    public class MyFirebaseMessagingService extends FirebaseMessagingService {
        @Override
        public void onMessageReceived(RemoteMessage remoteMessage) {
            RemoteMessage.Notification notification = remoteMessage.getNotification();
            //todo
        }
    }
    

    当我收到前台推送时,在调试中我可以看到它包含正确的通知内容: enter image description here

    但是通知:

    1. 包含title=null,body=null enter image description here enter image description here

    2. 条形图中的推送通知不包含标题和正文,看起来: enter image description here

    在我们的项目中,我们有两个不同的firebase项目,一个用于调试,另一个用于生产。 google-services.json 调试和发布生成类型中的文件。

    在我们开始使用不同的项目之前,一切都是正确的,推送通知包含一个标题和一个正文。

    我们(android团队)无法访问firebase控制台,项目是在没有我们的情况下设置的,我们只是实现了android“部分”。

    质询

    如何修复标题和正文在栏中的推送通知中的显示? 是我们的(android)错误还是firebase项目设置问题或后端实现?

    欢迎任何建议!提前谢谢!

    0 回复  |  直到 7 年前