0

i use following code to send notification by Firebase Admin , but image does not show in firefox developer , The image is displayed well in Chrome what should i do ?

    var path = _env.ContentRootPath + "/private_key_firebase.json";
    FirebaseApp app = null;
    try
    {
        app = FirebaseApp.GetInstance("webbitTask");
        if (app == null)
        {
            app = FirebaseApp.Create(new AppOptions()
            {
                Credential = GoogleCredential.FromFile(path)
            }, "webbitTask");
        }
    }
    catch (Exception ex)
    {
       return;
    }
    var fcm = FirebaseAdmin.Messaging.FirebaseMessaging.GetMessaging(app);
    Message message = new Message()
    {
        Notification = new Notification
        {
            Title = "Title of my notification",
            Body = "Content of my notification",
            ImageUrl = "https://my.webbit.ir/Admin/Templates/Default/images/backgrounds/logo144.png"
        },
        Webpush = new WebpushConfig()
        {
            FcmOptions = new WebpushFcmOptions()
            {
                Link = "https://www.webbit.ir",
            }
        },
        Token = "myToken"

    };

    await fcm.SendAsync(message);
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
msn.secret
  • 419
  • 5
  • 11

1 Answers1

0

I haven't confirmed myself, but looking at the notification documentation for Firefox, it uses a different property for the image URL.

in addition to ImageUrl - try adding image and/or icon

These optional properties take a USV string

Reference: https://developer.mozilla.org/en-US/docs/Web/API/Notification/Notification

DIGI Byte
  • 4,225
  • 1
  • 12
  • 20