1using System.Collections.Generic;
33 public string Sound {
get;
set; }
42 public string Tag {
get;
set; }
47 public string Color {
get;
set; }
82 public string Icon {
get;
set; }
95 base.ExportProperties(Message);
97 Dictionary<string, object> AndroidConfig =
new Dictionary<string, object>();
98 Dictionary<string, object> AndroidNotification =
new Dictionary<string, object>();
100 if (!
string.IsNullOrEmpty(this.
ChannelId))
101 AndroidNotification[
"channel_id"] = this.
ChannelId;
103 if (!
string.IsNullOrEmpty(this.
Sound))
104 AndroidNotification[
"sound"] = this.
Sound;
106 if (!
string.IsNullOrEmpty(this.
Tag))
107 AndroidNotification[
"tag"] = this.
Tag;
109 if (!
string.IsNullOrEmpty(this.
Color))
110 AndroidNotification[
"color"] = this.
Color;
112 if (!
string.IsNullOrEmpty(this.
Icon))
113 AndroidNotification[
"icon"] = this.
Icon;
131 if (AndroidNotification.Count > 0)
132 AndroidConfig[
"notification"] = AndroidNotification;
136 foreach (KeyValuePair<string, object> P
in Android2)
138 if (AndroidConfig.TryGetValue(P.Key, out
object Obj) &&
139 Obj is Dictionary<string, object> Obj1 &&
140 P.Value is Dictionary<string, object> Obj2)
142 foreach (KeyValuePair<string, object> P2
in Obj2)
143 Obj1[P2.Key] = P2.Value;
146 AndroidConfig[P.Key] = P.Value;
150 if (AndroidConfig.Count > 0)
151 Message[
"android"] = AndroidConfig;
164 case "android_channel_id":
166 this.ChannelId = Value?.ToString();
170 this.Sound = Value?.ToString();
174 this.Tag = Value?.ToString();
178 this.Color = Value?.ToString();
182 this.Icon = Value?.ToString();
186 this.BodyLocalizationKey = Value?.ToString();
189 case "body_loc_args":
197 case "title_loc_key":
198 this.TitleLocalizationKey = Value?.ToString();
201 case "title_loc_args":
210 this.AndroidSpecificDeliveryOptions = Value;
214 return base.TrySetProperty(Name, Value);
Notification message for Android
string ChannelId
The notification's channel id (new in Android O).
string Color
The notification's icon color, expressed in #rrggbb format.
object AndroidSpecificDeliveryOptions
Android-specific delivery options.
string[] TitleLocalizationArguments
Variable string values to be used in place of the format specifiers in title_loc_key to use to locali...
string BodyLocalizationKey
The key to the body string in the app's string resources to use to localize the body text to the user...
string TitleLocalizationKey
The key to the title string in the app's string resources to use to localize the title text to the us...
string Sound
The sound to play when the device receives the notification.
override void ExportProperties(Dictionary< string, object > Message)
Prepares the object to send to Firebase.
string Icon
The URL to use for the notification's icon.
NotificationMessageAndroid()
Notification message for Android
string Tag
Identifier used to replace existing notifications in the notification drawer.
string[] BodyLocalizationArguments
Variable string values to be used in place of the format specifiers in body_loc_key to use to localiz...
override bool TrySetProperty(string Name, object Value)
Tries to set a property value.
Base class for Notification messages