Firebase 云消息传递报告错误
Firebase Cloud Messaging Reports wrong
我正在向我的应用程序发送云消息,但 Firebase-CF-Reports 告诉我不会收到它们:
但我确信某些设备确实会收到它们。例如我自己的。所以报告中出现了问题。
我读到了这个问题 and ,但我已经有一个分析标签,我会用我的云消息发送它。
这就是我使用 java-admin-sdk 发送通知的方式:
Message message = Message.builder()
.setTopic(topic)
.setAndroidConfig(AndroidConfig.builder()
.setPriority(AndroidConfig.Priority.HIGH)
.build())
.setApnsConfig(ApnsConfig.builder()
.setAps(Aps.builder()
.setMutableContent(true)
.setContentAvailable(true)
.build())
.putHeader("apns-push-type", "background")
.putHeader("apns-priority", "5")
.putHeader("apns-topic", "my.bundle.id")
.build())
.putData("\"content\"", contentString)
.putData("\"actionButtons\"", actionButtonsString)
.setFcmOptions(FcmOptions.withAnalyticsLabel("SendToAll"))
.build();
同样有趣的是,如果我没有过滤 Platform/Channel
(虽然仍然只过滤我的 android 应用 Apps=
),我得到这个:
但这些数字仍然没有任何意义。我还在自己的设备上打开了一些通知。我简直不敢相信只收到了 18 个。
有人知道我做错了什么吗?
我在我的 flutter 应用程序中使用这个 fcm-sdk:
firebase_messaging: ^9.1.2
尽管我没有在官方文档中找到这个,但我在这个答案的评论 中找到了这个讨论中的信息。事实证明,订阅 FCM 中的主题不一定是永久的。所以不要让用户一次订阅一个主题。而是在每次应用程序启动时执行此操作,尽管它是
"not technically necessary. It may depend on your use case. For
example, if you want a global topic where all users are a member of,
you'd have to make sure that they are subscribed to it. Putting the
subscribe method when the app starts guarantees this."
- -@AL.
自从我更改后,收到通知的人比以前多了很多。只有开放计数仍然不适合我。它始终为零。
我正在向我的应用程序发送云消息,但 Firebase-CF-Reports 告诉我不会收到它们:
但我确信某些设备确实会收到它们。例如我自己的。所以报告中出现了问题。
我读到了这个问题
这就是我使用 java-admin-sdk 发送通知的方式:
Message message = Message.builder()
.setTopic(topic)
.setAndroidConfig(AndroidConfig.builder()
.setPriority(AndroidConfig.Priority.HIGH)
.build())
.setApnsConfig(ApnsConfig.builder()
.setAps(Aps.builder()
.setMutableContent(true)
.setContentAvailable(true)
.build())
.putHeader("apns-push-type", "background")
.putHeader("apns-priority", "5")
.putHeader("apns-topic", "my.bundle.id")
.build())
.putData("\"content\"", contentString)
.putData("\"actionButtons\"", actionButtonsString)
.setFcmOptions(FcmOptions.withAnalyticsLabel("SendToAll"))
.build();
同样有趣的是,如果我没有过滤 Platform/Channel
(虽然仍然只过滤我的 android 应用 Apps=
),我得到这个:
但这些数字仍然没有任何意义。我还在自己的设备上打开了一些通知。我简直不敢相信只收到了 18 个。
有人知道我做错了什么吗?
我在我的 flutter 应用程序中使用这个 fcm-sdk:
firebase_messaging: ^9.1.2
尽管我没有在官方文档中找到这个,但我在这个答案的评论
"not technically necessary. It may depend on your use case. For example, if you want a global topic where all users are a member of, you'd have to make sure that they are subscribed to it. Putting the subscribe method when the app starts guarantees this."
- -@AL.
自从我更改后,收到通知的人比以前多了很多。只有开放计数仍然不适合我。它始终为零。