Create Notification and Data messages
masterFCM messages generally fall into two categories: Notifications (which include a title, body, and image) and Data messages (which contain custom key-value pairs). You can also send both in a single message.
from firebase_admin.messaging import Message, Notification
# Notification message
notification_msg = Message(
notification=Notification(title="title", body="text", image="url"),
topic="Optional topic parameter",
)
# Data message
data_msg = Message(
data={
"Nick" : "Mario",
"body" : "great match!",
"Room" : "PortugalVSDenmark"
},
topic="Optional topic parameter",
)