Closed jwoodwardtfx closed 2 years ago
They will be added eventually. Feel free to send a PR in the meantime. Following API signatures have been proposed to expose these options in .NET:
public sealed class AndroidNotification
{
public enum Priority
{
MIN,
LOW,
DEFAULT,
HIGH,
MAX,
}
public enum Visibility
{
PRIVATE,
PUBLIC,
SECRET,
}
[JsonProperty("title")]
public string Title { get; set; }
[JsonProperty("body")]
public string Body { get; set; }
[JsonProperty("icon")]
public string Icon { get; set; }
[JsonProperty("color")]
public string Color { get; set; }
[JsonProperty("sound")]
public string Sound { get; set; }
[JsonProperty("tag")]
public string Tag { get; set; }
[JsonProperty("image")]
public string ImageUrl { get; set; }
[JsonProperty("click_action")]
public string ClickAction { get; set; }
[JsonProperty("title_loc_key")]
public string TitleLocKey { get; set; }
[JsonProperty("title_loc_args")]
public IEnumerable<string> TitleLocArgs { get; set; }
[JsonProperty("body_loc_key")]
public string BodyLocKey { get; set; }
[JsonProperty("body_loc_args")]
public IEnumerable<string> BodyLocArgs { get; set; }
[JsonProperty("channel_id")]
public string ChannelId { get; set; }
[JsonProperty("ticker")]
public string Ticker { get; set; }
[JsonProperty("sticky")]
public bool Sticky { get; set; }
[JsonProperty("event_time")]
public DateTime EventTimestamp { get; set; }
[JsonProperty("local_only")]
public bool LocalOnly { get; set; }
[JsonProperty("priority")]
public AndroidNotification.Priority? Priority { get; set; }
[JsonProperty("vibrate_timings")]
public long[] VibrateTimingsMillis { get; set; }
[JsonProperty("default_vibrate_timings")]
public bool DefaultVibrateTimings { get; set; }
[JsonProperty("default_sound")]
public bool DefaultSound { get; set; }
[JsonProperty("light_settings")]
public LightSettings LightSettings { get; set; }
[JsonProperty("default_light_settings")]
public bool DefaultLightSettings { get; set; }
[JsonProperty("visibility")]
public AndroidNotification.Visibility? Visibility { get; set; }
[JsonProperty("notification_count")]
public int? NotificationCount { get; set; }
}
// Add new class for LightSettings
public sealed class LightSettings
{
[JsonProperty("color")]
public string Color { get; set; }
[JsonProperty("light_on_duration")]
public long LightOnDurationMillis { get; set; }
[JsonProperty("light_off_durtaion")]
public long LightOffDurationMillis { get; set; }
}
Is anyone working on this, or can I take a stab at it?
@levimatheri nobody's working on it afaik. Feel free to provide a PR :)
Is there some way of adding the "title_loc_key" to the base Notification object? It seems to be needed for iOS localization of messages as described here:
Snippet:
Finally, when sending the payload would look like this:
{
"notification": {
"title_loc_key" : "NOTIFICATION_TITLE",
"body_loc_key" : "NOTIFICATION_MESSAGE"
},
"priority": "high",
"condition": "'general' in topics"
}
It doesn't seem to work when using the AndroidConfig class.
Is anyone working on this, or can I take a stab at it?
@levimatheri Did you make any progress on a PR for this?
@hiranya911 seems like even after a year, nothing has happened to making the payload feature complete with v1, why? Is this package deprecated?
@WillooWisp I had submitted a PR here a while back.
@hiranya911 and @lahirumaramba why is the PR above not being merge, when you requested it over a year ago?
Please make a new NuGet release with this included.
@WillooWisp Thank you for pointing this out! Apologies for the delay, we have started the review process. Stay tuned for an update on the release.
This feature is now available in v2.3.0. Thank you for your patience!
It seems there are a lot of newer options for FCM not available in the .NET Firebase Admin (see https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#AndroidNotification).
Specifically the newer options for AndroidNotifications. The current class ends at "channel_id", however the following are now available:
"ticker": string, "sticky": boolean, "event_time": string, "local_only": boolean, "notification_priority": enum (NotificationPriority), "default_sound": boolean, "default_vibrate_timings": boolean, "default_light_settings": boolean, "vibrate_timings": [ string ], "visibility": enum (Visibility), "notification_count": integer, "light_settings": { object (LightSettings) }, "image": string
Is there any plan to add support for these?