Skip to content

Commit a047dde

Browse files
committed
Added support for analytics_label
1 parent f640512 commit a047dde

File tree

6 files changed

+36
-1
lines changed

6 files changed

+36
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ bin/
22
obj/
33
.vscode/
44
.vs/
5+
.idea/

FirebaseAdmin/FirebaseAdmin/FirebaseAdmin.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<Version>1.7.0</Version>

FirebaseAdmin/FirebaseAdmin/Messaging/AndroidConfig.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ public sealed class AndroidConfig
6666
[JsonProperty("notification")]
6767
public AndroidNotification Notification { get; set; }
6868

69+
/// <summary>
70+
/// Gets or sets the FCM options to be included in the message.
71+
/// </summary>
72+
[JsonProperty("fcm_options")]
73+
public FcmOptions FcmOptions { get; set; }
74+
6975
/// <summary>
7076
/// Gets or sets the string representation of <see cref="Priority"/> as accepted by the FCM
7177
/// backend service.

FirebaseAdmin/FirebaseAdmin/Messaging/ApnsConfig.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ public sealed class ApnsConfig
3535
[JsonProperty("headers")]
3636
public IReadOnlyDictionary<string, string> Headers { get; set; }
3737

38+
/// <summary>
39+
/// Gets or sets the FCM options to be included in the message.
40+
/// </summary>
41+
[JsonProperty("fcm_options")]
42+
public FcmOptions FcmOptions { get; set; }
43+
3844
/// <summary>
3945
/// Gets or sets the <c>aps</c> dictionary to be included in the APNs payload.
4046
/// </summary>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Newtonsoft.Json;
2+
3+
namespace FirebaseAdmin.Messaging
4+
{
5+
/// <summary>
6+
/// Represents FCM options.
7+
/// </summary>
8+
public class FcmOptions
9+
{
10+
/// <summary>
11+
/// Gets or sets analytics label.
12+
/// </summary>
13+
[JsonProperty("analytics_label")]
14+
public string AnalyticsLabel { get; set; }
15+
}
16+
}

FirebaseAdmin/FirebaseAdmin/Messaging/Message.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ public sealed class Message
8080
[JsonProperty("apns")]
8181
public ApnsConfig Apns { get; set; }
8282

83+
/// <summary>
84+
/// Gets or sets the FCM options to be included in the message.
85+
/// </summary>
86+
[JsonProperty("fcm_options")]
87+
public FcmOptions FcmOptions { get; set; }
88+
8389
/// <summary>
8490
/// Gets or sets the formatted representation of the <see cref="Topic"/>. Removes the
8591
/// <c>/topics/</c> prefix if present. This is what's ultimately sent to the FCM

0 commit comments

Comments
 (0)