Best practice for including private images in FCM push notifications

303 views
Skip to first unread message

Chris Harris

unread,
Oct 23, 2023, 12:04:49 PM10/23/23
to Firebase Google Group
Hello,

What is the best practice for including private images in FCM push notifications? If you add an image URL to an FCM notification then it must be publicly accessible, but it is not secure to add authentication information to a URL. Is it only possible to securely send private image URLs in data messages and have the application perform authentication and fetching of image?

Thanks,
Chris

Arthur Thompson

unread,
Oct 23, 2023, 1:35:32 PM10/23/23
to fireba...@googlegroups.com
Hi Chris,

You are correct. If you want the FCM SDK to handle the fetching of the image for you then it needs to be a public image. Placing the URL in the data payload of a message allows you to keep it private however you will have to handle the fetching of the image yourself.

Note that for private data you should use tokens (not topics) for targeting recipients.

I hope this helps,
Arthur.

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/392540fc-12bf-4178-aeef-063b9c895e6cn%40googlegroups.com.

Chris Harris

unread,
Oct 24, 2023, 2:21:30 PM10/24/23
to Firebase Google Group
Great thanks Arthur!
Reply all
Reply to author
Forward
0 new messages