[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fcm): Added support for specifying analytics label in notifications #89

Merged
merged 6 commits into from
Jul 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ bin/
obj/
.vscode/
.vs/
.idea/
2 changes: 1 addition & 1 deletion FirebaseAdmin/FirebaseAdmin/FirebaseAdmin.csproj
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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; }
RannyRanny marked this conversation as resolved.
Show resolved Hide resolved

/// <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
Original file line number Diff line number Diff line change
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; }
RannyRanny marked this conversation as resolved.
Show resolved Hide resolved

/// <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
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Newtonsoft.Json;

namespace FirebaseAdmin.Messaging
{
/// <summary>
/// Represents FCM options.
/// </summary>
public class FcmOptions
RannyRanny marked this conversation as resolved.
Show resolved Hide resolved
{
/// <summary>
/// Gets or sets analytics label.
/// </summary>
[JsonProperty("analytics_label")]
public string AnalyticsLabel { get; set; }
}
}
RannyRanny marked this conversation as resolved.
Show resolved Hide resolved
6 changes: 6 additions & 0 deletions FirebaseAdmin/FirebaseAdmin/Messaging/Message.cs
Original file line number Diff line number Diff line change
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