Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
NotificationMessageWeb.cs
1using System.Collections.Generic;
2
4{
11 {
16 {
17 }
18
22 public string Link { get; set; }
23
27 public object WebPushSpecificDeliveryOptions { get; set; }
28
33 public override void ExportProperties(Dictionary<string, object> Message)
34 {
35 base.ExportProperties(Message);
36
37 Dictionary<string, object> WebPushConfig = new Dictionary<string, object>();
38 Dictionary<string, object> WebPushFcmOptions = new Dictionary<string, object>();
39
40 if (!string.IsNullOrEmpty(this.Link))
41 WebPushFcmOptions["link"] = this.Link;
42
43 if (WebPushFcmOptions.Count > 0)
44 WebPushConfig["webpush"] = WebPushFcmOptions;
45
46
47 if (this.WebPushSpecificDeliveryOptions is Dictionary<string, object> WebPushConfig2)
48 {
49 foreach (KeyValuePair<string, object> P in WebPushConfig2)
50 {
51 if (WebPushConfig.TryGetValue(P.Key, out object Obj) &&
52 Obj is Dictionary<string, object> Obj1 &&
53 P.Value is Dictionary<string, object> Obj2)
54 {
55 foreach (KeyValuePair<string, object> P2 in Obj2)
56 Obj1[P2.Key] = P2.Value;
57 }
58 else
59 WebPushConfig[P.Key] = P.Value;
60 }
61 }
62
63 if (WebPushConfig.Count > 0)
64 Message["webpush"] = WebPushConfig;
65 }
66
73 public override bool TrySetProperty(string Name, object Value)
74 {
75 switch (Name)
76 {
77 case "link":
78 this.Link = Value?.ToString();
79 return true;
80
81 case "webpush":
82 this.WebPushSpecificDeliveryOptions = Value;
83 break;
84 }
85
86 return base.TrySetProperty(Name, Value);
87 }
88
89 }
90}
override void ExportProperties(Dictionary< string, object > Message)
Prepares the object to send to Firebase.
object WebPushSpecificDeliveryOptions
Web-Push-specific delivery options.
override bool TrySetProperty(string Name, object Value)
Tries to set a property value.