Using fcm v0.4.0 setting Notification.Badge causes FCM to reject the push notification with a error code of 200.
Example code:
package main
import (
"log"
"github.com/edganiukov/fcm"
)
func main() {
// Create the message to be sent.
msg := &fcm.Message{
Token: "sample_device_token",
Notification: &fcm.Notification{
Title: "Test Message",
Body: "This is a test message with a badge set",
Badge: "/images/fcm-icon.png",
},
}
// Create a FCM client to send the message.
client, err := fcm.NewClient("sample_api_key")
if err != nil {
log.Fatal(err)
}
// Send the message and receive the response without retries.
response, err := client.Send(msg)
if err != nil {
/* ... */
}
log.Printf("resp: %v", response)
}
If I use Notification.Icon instead of Notification.Badge then the message is accepted and delivered without issue but the badge on the notification is the Android default "ringing bell" instead of the desired app icen.
Using fcm v0.4.0 setting
Notification.Badge
causes FCM to reject the push notification with a error code of 200.Example code:
response:
If I use
Notification.Icon
instead ofNotification.Badge
then the message is accepted and delivered without issue but the badge on the notification is the Android default "ringing bell" instead of the desired app icen.