FCM icon indicating copy to clipboard operation
FCM copied to clipboard

Example of How to Send Image

Open Kevin-French opened this issue 11 months ago • 1 comments

Can someone please provide an example of how to send an image with the notification? I haven't been able to figure out how to do it. The below does not show an image in the notification.

let message = FCMMessageDefault( topic: "test-topic", notification: FCMNotification(title: title, body: body), apns: FCMApnsConfig( options: .init( analyticsLabel: "label", image: "https://firebasestorage.googleapis.com/v0/b/sweetliliestest.appspot.com/o/lacos%2F1722574617287-4BYAh.jpg?alt=media&token=a5cc6580-cf55-4ded-a4ef-7b1a2351b4bc") ) )

Kevin-French avatar Dec 20 '24 14:12 Kevin-French

Have you already implemented Notification Content and Notification Service extensions? If I understand the task correctly, this is only possible by implementing these custom targets to process the incoming push and display it with the image. In these targets, you will be able to retrieve the link to the image from the payload and use it to render the notification as desired. You can explore this further by reading this Stack Overflow post, this article, or watching this WWDC session on rich notifications.

MihaelIsaev avatar Dec 24 '24 10:12 MihaelIsaev