• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rj76 / fcm-rust / 8128893026

03 Mar 2024 08:21AM UTC coverage: 5.216% (+0.02%) from 5.2%
8128893026

Pull #4

github

web-flow
Merge 2128a958a into a8babd228
Pull Request #4: feat: build new api

621 of 32863 branches covered (1.89%)

Branch coverage included in aggregate %.

108 of 396 new or added lines in 21 files covered. (27.27%)

252 existing lines in 48 files now uncovered.

15129 of 269097 relevant lines covered (5.62%)

202.27 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/android/android_config.rs
1
use serde::Serialize;
2
use serde_json::Value;
3

4
use super::{
5
    android_fcm_options::{AndroidFcmOptions, AndroidFcmOptionsInternal},
6
    android_message_priority::AndroidMessagePriority,
7
    android_notification::{AndroidNotification, AndroidNotificationInternal},
8
};
9

NEW
10
#[derive(Serialize, Debug)]
×
11
pub(crate) struct AndroidConfigInternal {
12
    #[serde(skip_serializing_if = "Option::is_none")]
13
    collapse_key: Option<String>,
14

15
    #[serde(skip_serializing_if = "Option::is_none")]
NEW
16
    priority: Option<AndroidMessagePriority>,
×
17

18
    #[serde(skip_serializing_if = "Option::is_none")]
NEW
19
    ttl: Option<String>,
×
20

21
    #[serde(skip_serializing_if = "Option::is_none")]
NEW
22
    restricted_package_name: Option<String>,
×
23

24
    #[serde(skip_serializing_if = "Option::is_none")]
NEW
25
    data: Option<Value>,
×
26

27
    #[serde(skip_serializing_if = "Option::is_none")]
NEW
28
    notification: Option<AndroidNotificationInternal>,
×
29

30
    #[serde(skip_serializing_if = "Option::is_none")]
NEW
31
    fcm_options: Option<AndroidFcmOptionsInternal>,
×
32

33
    #[serde(skip_serializing_if = "Option::is_none")]
NEW
34
    direct_boot_ok: Option<bool>,
×
35
}
36

NEW
37
#[derive(Debug, Default)]
×
38
/// https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages?authuser=0#androidconfig
39
pub struct AndroidConfig {
40
    /// An identifier of a group of messages that can be collapsed, so that only the last message gets
41
    /// sent when delivery can be resumed.
NEW
42
    pub collapse_key: Option<String>,
×
43

44
    /// Message priority.
NEW
45
    pub priority: Option<AndroidMessagePriority>,
×
46

47
    /// How long (in seconds) the message should be kept in FCM storage if the device is offline.
48
    /// Duration format: https://developers.google.com/protocol-buffers/docs/reference/google.protobuf?authuser=0#google.protobuf.Duration
NEW
49
    pub ttl: Option<String>,
×
50

51
    /// Package name of the application where the registration token must match in order to receive the message.
NEW
52
    pub restricted_package_name: Option<String>,
×
53

54
    /// Arbitrary key/value payload.
NEW
55
    pub data: Option<Value>,
×
56

57
    /// Notification to send to android devices.
NEW
58
    pub notification: Option<AndroidNotification>,
×
59

60
    /// Options for features provided by the FCM SDK for Android.
NEW
61
    pub fcm_options: Option<AndroidFcmOptions>,
×
62

63
    /// If set to true, messages will be allowed to be delivered to the app while the device is in direct boot mode.
NEW
64
    pub direct_boot_ok: Option<bool>,
×
65
}
66

67
impl AndroidConfig {
NEW
68
    pub(crate) fn finalize(self) -> AndroidConfigInternal {
×
NEW
69
        AndroidConfigInternal {
×
NEW
70
            collapse_key: self.collapse_key,
×
NEW
71
            priority: self.priority,
×
NEW
72
            ttl: self.ttl,
×
NEW
73
            restricted_package_name: self.restricted_package_name,
×
NEW
74
            data: self.data,
×
NEW
75
            notification: self.notification.map(|n| n.finalize()),
×
NEW
76
            fcm_options: self.fcm_options.map(|f| f.finalize()),
×
NEW
77
            direct_boot_ok: self.direct_boot_ok,
×
78
        }
NEW
79
    }
×
80
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc