Firebase Cloud Messaging Reports wrong

254

Despite I did not find this in the official documentation, I found information in this discussion in the comments to this answer here. Turns out that subscribing to a topic in FCM is not necessarily permanent. So don't subscribe users to a topic once. Instead do it on every app start, although it is

"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.

Since I changed that, the Notifications are received by a lot more people than before. Only the open-count is still not working for me. It is always on zero.

Share:
254
progNewbie
Author by

progNewbie

I am a computer science student from Germany. I spend a lot of my free time with programming apps or webpages.

Updated on December 29, 2022

Comments

  • progNewbie
    progNewbie over 1 year

    I am sending cloud-messages to my app but Firebase-CF-Reports tells me that they would not be received:

    But I know for sure that some devices do receive them. e.g. my own. So something is going wrong here in the reports.

    I read about this problem here and here but I already have an analytics-label that I send with my cloud-message.

    This is how I sent my notifications with 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();
    

    enter image description here

    Also interesting is, that If I am not filtering for Platform/Channel (altough still filter only for my android app with Apps=) I get this:

    enter image description here

    But these numbers still don't make any sense. I also opened some notifications on my own device. And I can't believe that only 18 were received.

    Has anyone an idea what I am doing wrong?

    I use this fcm-sdk in my flutter app:

    firebase_messaging: ^9.1.2