Skip to content

Commit

Permalink
Added support for analytics_label
Browse files Browse the repository at this point in the history
  • Loading branch information
RannyRanny committed Jul 16, 2019
1 parent f640512 commit a047dde
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@ bin/
obj/
.vscode/
.vs/
.idea/
2 changes: 1 addition & 1 deletion FirebaseAdmin/FirebaseAdmin/FirebaseAdmin.csproj
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.7.0</Version>
Expand Down
6 changes: 6 additions & 0 deletions FirebaseAdmin/FirebaseAdmin/Messaging/AndroidConfig.cs
Expand Up @@ -66,6 +66,12 @@ public sealed class AndroidConfig
[JsonProperty("notification")]
public AndroidNotification Notification { get; set; }

/// <summary>
/// Gets or sets the FCM options to be included in the message.
/// </summary>
[JsonProperty("fcm_options")]
public FcmOptions FcmOptions { get; set; }

/// <summary>
/// Gets or sets the string representation of <see cref="Priority"/> as accepted by the FCM
/// backend service.
Expand Down
6 changes: 6 additions & 0 deletions FirebaseAdmin/FirebaseAdmin/Messaging/ApnsConfig.cs
Expand Up @@ -35,6 +35,12 @@ public sealed class ApnsConfig
[JsonProperty("headers")]
public IReadOnlyDictionary<string, string> Headers { get; set; }

/// <summary>
/// Gets or sets the FCM options to be included in the message.
/// </summary>
[JsonProperty("fcm_options")]
public FcmOptions FcmOptions { get; set; }

/// <summary>
/// Gets or sets the <c>aps</c> dictionary to be included in the APNs payload.
/// </summary>
Expand Down
16 changes: 16 additions & 0 deletions FirebaseAdmin/FirebaseAdmin/Messaging/FcmOptions.cs
@@ -0,0 +1,16 @@
using Newtonsoft.Json;

namespace FirebaseAdmin.Messaging
{
/// <summary>
/// Represents FCM options.
/// </summary>
public class FcmOptions
{
/// <summary>
/// Gets or sets analytics label.
/// </summary>
[JsonProperty("analytics_label")]
public string AnalyticsLabel { get; set; }
}
}
6 changes: 6 additions & 0 deletions FirebaseAdmin/FirebaseAdmin/Messaging/Message.cs
Expand Up @@ -80,6 +80,12 @@ public sealed class Message
[JsonProperty("apns")]
public ApnsConfig Apns { get; set; }

/// <summary>
/// Gets or sets the FCM options to be included in the message.
/// </summary>
[JsonProperty("fcm_options")]
public FcmOptions FcmOptions { get; set; }

/// <summary>
/// Gets or sets the formatted representation of the <see cref="Topic"/>. Removes the
/// <c>/topics/</c> prefix if present. This is what's ultimately sent to the FCM
Expand Down

0 comments on commit a047dde

Please sign in to comment.