I have an android application that uses FCM to get notifications. I'm using this versions:
implementation "com.google.firebase:firebase-analytics-ktx:17.4.3"
implementation "com.google.firebase:firebase-inappmessaging-display-ktx:19.0.7"
implementation "com.google.firebase:firebase-messaging:20.2.0"
The problem that I've encountered recently is that I tried to send push notification with my own backend server via REST API call. I noticed that for every single api call, android devices get notifications twice.
So I've checked this Question: Firebase send push notification twice and I noticed that like Tom Bevelander's answer, I have a third party lib that uses GCM behind and when I removed that lib from project, problem fixed.
So I have to force my users to update the application. but I don't really want this approach. Something that I saw is that on previous version (GCM included app) when I'm testing push notification with Firebase Panel itself, everything works fine and devices get single notification. but with api call, devices get duplicate notifs. What is the difference between this approaches? How can I find out whats happening behind the FirebasePanel? So that I call same api that panel uses itself? The endpoints that I've tested is this:
https://fcm.googleapis.com/fcm/send
and this:
https://fcm.googleapis.com/v1/projects/myproject-b5ae1/messages:send