Skip to main content

firebase_sdk_rs/
message.rs

1use serde::{Deserialize, Serialize};
2use std::collections::HashMap;
3
4#[derive(Debug, Deserialize, Serialize)]
5pub struct Notification {
6    pub title: String,
7    pub body: String,
8}
9
10#[derive(Debug, Deserialize, Serialize)]
11pub struct DeviceMessage {
12    pub token: String,
13    pub notification: Option<Notification>,
14    pub data: Option<HashMap<String, String>>,
15}
16
17#[derive(Debug, Deserialize, Serialize)]
18pub struct TopicMessage {
19    pub topic: String,
20    pub notification: Option<Notification>,
21    pub data: Option<HashMap<String, String>>,
22}