@@ -31,3 +31,129 @@ export interface Notification {
3131 /** URL of an image to include in the notification. */
3232 image ?: string ;
3333}
34+
35+ // -----------------------------------------------------------------------------
36+ // FM Delivery Data Interfaces
37+ // -----------------------------------------------------------------------------
38+
39+ /**
40+ * Additional information about [proxy notification] delivery.
41+ * All percentages are calculated with 'countNotificationsAccepted' as the denominator.
42+ */
43+ export interface ProxyNotificationInsightPercents {
44+ /** The percentage of accepted notifications that were successfully proxied. */
45+ proxied ?: number ;
46+ /** The percentage of accepted notifications that failed to be proxied. */
47+ failed ?: number ;
48+ /** The percentage of accepted notifications that were skipped because proxy notification is unsupported for the recipient. */
49+ skippedUnsupported : number ;
50+ /** The percentage of accepted notifications that were skipped because the messages were not throttled. */
51+ skippedNotThrottled : number ;
52+ /** The percentage of accepted notifications that were skipped because configurations required for notifications to be proxied were missing. */
53+ skippedUnconfigured : number ;
54+ /** The percentage of accepted notifications that were skipped because the app disallowed these messages to be proxied. */
55+ skippedOptedOut : number ;
56+ }
57+
58+ /**
59+ * Additional information about message delivery. All percentages are calculated
60+ * with 'countMessagesAccepted' as the denominator.
61+ */
62+ export interface MessageInsightPercents {
63+ /** The percentage of accepted messages that had their priority lowered from high to normal. */
64+ priorityLowered : number ;
65+ }
66+
67+ /**
68+ * Overview of delivery performance for messages that were successfully delivered.
69+ * All percentages are calculated with 'countMessagesAccepted' as the denominator.
70+ */
71+ export interface DeliveryPerformancePercents {
72+ /** The percentage of accepted messages that were delivered to the device without delay from the FCM system. */
73+ deliveredNoDelay : number ;
74+ /** The percentage of accepted messages that were delayed because the target device was not connected at the time of sending. */
75+ delayedDeviceOffline : number ;
76+ /** The percentage of accepted messages that were delayed because the device was in doze mode. */
77+ delayedDeviceDoze : number ;
78+ /** The percentage of accepted messages that were delayed due to message throttling. */
79+ delayedMessageThrottled : number ;
80+ /** The percentage of accepted messages that were delayed because the intended device user-profile was stopped. */
81+ delayedUserStopped : number ;
82+ }
83+
84+ /**
85+ * Percentage breakdown of message delivery outcomes. These categories are mutually exclusive.
86+ * All percentages are calculated with 'countMessagesAccepted' as the denominator.
87+ */
88+ export interface MessageOutcomePercents {
89+ /** The percentage of all accepted messages that were successfully delivered to the device. */
90+ delivered : number ;
91+ /** The percentage of messages accepted that were not dropped and not delivered, due to the device being disconnected. */
92+ pending : number ;
93+ /** The percentage of accepted messages that were collapsed by another message. */
94+ collapsed : number ;
95+ /** The percentage of accepted messages that were dropped due to too many undelivered non-collapsible messages. */
96+ droppedTooManyPendingMessages : number ;
97+ /** The percentage of accepted messages that were dropped because the application was force stopped. */
98+ droppedAppForceStopped : number ;
99+ /** The percentage of accepted messages that were dropped because the target device is inactive. */
100+ droppedDeviceInactive : number ;
101+ /** The percentage of accepted messages that expired because Time To Live (TTL) elapsed. */
102+ droppedTtlExpired : number ;
103+ }
104+
105+ /**
106+ * Data detailing messaging delivery
107+ */
108+ export interface Data {
109+ /** Count of messages accepted by FCM intended for Android devices. */
110+ countMessagesAccepted : string ; // Use string for int64 to prevent potential precision issues
111+ /** Count of notifications accepted by FCM intended for Android devices. */
112+ countNotificationsAccepted : string ; // Use string for int64
113+ /** Mutually exclusive breakdown of message delivery outcomes. */
114+ messageOutcomePercents : MessageOutcomePercents ;
115+ /** Additional information about delivery performance for messages that were successfully delivered. */
116+ deliveryPerformancePercents : DeliveryPerformancePercents ;
117+ /** Additional general insights about message delivery. */
118+ messageInsightPercents : MessageInsightPercents ;
119+ /** Additional insights about proxy notification delivery. */
120+ proxyNotificationInsightPercents : ProxyNotificationInsightPercents ;
121+ }
122+
123+ // -----------------------------------------------------------------------------
124+ // Core API Interfaces
125+ // -----------------------------------------------------------------------------
126+
127+ /**
128+ * Message delivery data for a given date, app, and analytics label combination.
129+ */
130+ export interface AndroidDeliveryData {
131+ /** The app ID to which the messages were sent. */
132+ appId : string ;
133+ /** The date represented by this entry. */
134+ date : {
135+ year : number ;
136+ month : number ;
137+ day : number ;
138+ } ;
139+ /** The analytics label associated with the messages sent. */
140+ analyticsLabel : string ;
141+ /** The data for the specified combination. */
142+ data : Data ;
143+ }
144+
145+ /**
146+ * Response message for ListAndroidDeliveryData.
147+ */
148+ export interface ListAndroidDeliveryDataResponse {
149+ /**
150+ * The delivery data for the provided app.
151+ * There will be one entry per combination of app, date, and analytics label.
152+ */
153+ androidDeliveryData : AndroidDeliveryData [ ] ;
154+ /**
155+ * A token, which can be sent as `page_token` to retrieve the next page.
156+ * If this field is omitted, there are no subsequent pages.
157+ */
158+ nextPageToken ?: string ;
159+ }
0 commit comments