Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example of How to Send Image #55

Open
Kevin-French opened this issue Dec 20, 2024 · 1 comment
Open

Example of How to Send Image #55

Kevin-French opened this issue Dec 20, 2024 · 1 comment

Comments

@Kevin-French
Copy link

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

@MihaelIsaev
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants