|
@@ -0,0 +1,519 @@
|
|
1
|
+
|
|
2
|
+# 引用包
|
|
3
|
+```
|
|
4
|
+<PackageReference Include="Flurl" Version="2.8.2" />
|
|
5
|
+<PackageReference Include="Flurl.Http" Version="2.4.2" />
|
|
6
|
+```
|
|
7
|
+
|
|
8
|
+# 触发时间
|
|
9
|
+
|
|
10
|
+- 触发原理:当用户在手机上点击了某个按钮,我们需要把延迟的时间记录到Quartz.Net数据表里。
|
|
11
|
+- QuartzNet运作原理:创建一个`IJob`作业,把设置保存到QuartzNet专有的表。当触发的时候,QuartzNet会调用我们定义好的接口,发送极光推送以及把一条通知记录保存到数据库的Noti表。
|
|
12
|
+
|
|
13
|
+首先有关配置。
|
|
14
|
+```
|
|
15
|
+namespace DD.Libs.TasksManager
|
|
16
|
+{
|
|
17
|
+ /// <summary>
|
|
18
|
+ /// 极光配置
|
|
19
|
+ /// </summary>
|
|
20
|
+ public class JobSetting : IOptions<JobSetting>
|
|
21
|
+ {
|
|
22
|
+ public JobSetting Value => this;
|
|
23
|
+
|
|
24
|
+ /// <summary>
|
|
25
|
+ /// 执行场景任务的url
|
|
26
|
+ /// http://47.103.61.198:5002/api/tasks/cj/
|
|
27
|
+ /// </summary>
|
|
28
|
+ public string sceneUrl { get; set; }
|
|
29
|
+
|
|
30
|
+ /// <summary>
|
|
31
|
+ /// 定时任务的url
|
|
32
|
+ /// http://47.103.61.198:5002/api/tasks/ds/
|
|
33
|
+ public string timingUrl { get; set; }
|
|
34
|
+
|
|
35
|
+ /// <summary>
|
|
36
|
+ /// 连接字符串的一部分
|
|
37
|
+ /// Port=3306;Database=quartznet;Uid=root;Pwd=pass;SslMode=none
|
|
38
|
+ /// </summary>
|
|
39
|
+ public string quartz { get; set; }
|
|
40
|
+
|
|
41
|
+ /// <summary>
|
|
42
|
+ /// 连接字符串的一部分
|
|
43
|
+ /// 192.168.9.108
|
|
44
|
+ /// </summary>
|
|
45
|
+ public string server { get; set; }
|
|
46
|
+ }
|
|
47
|
+}
|
|
48
|
+```
|
|
49
|
+
|
|
50
|
+在`appSetting.json`中配置
|
|
51
|
+```
|
|
52
|
+ "Tasks": { //场景和定时
|
|
53
|
+ "sceneUrl": "http://47.103.61.198:5005/api/tasks/noti/", //写字楼版QuartzNet触发发生时调用的接口
|
|
54
|
+ "timingUrl": "", //定时地址
|
|
55
|
+ "server": "47.103.61.198",
|
|
56
|
+ "quartz": "Port=3306;Database=ddquartz1;Uid=root;Pwd=TecheDing2019;SslMode=none"
|
|
57
|
+ },
|
|
58
|
+```
|
|
59
|
+
|
|
60
|
+接口实现:
|
|
61
|
+```
|
|
62
|
+namespace DD.Warning.WebUI.Controllers
|
|
63
|
+{
|
|
64
|
+ /// <summary>
|
|
65
|
+ /// 场景和定时在这里执行
|
|
66
|
+ /// </summary>
|
|
67
|
+ [AllowAnonymous]
|
|
68
|
+ [Produces("application/json")]
|
|
69
|
+ [Route("api/tasks")]
|
|
70
|
+ public class TaiHeRealController : Controller
|
|
71
|
+ {
|
|
72
|
+
|
|
73
|
+ private readonly IMediator _mediator; //中介者
|
|
74
|
+ private readonly ILogger<TaiHeRealController> _logger;
|
|
75
|
+
|
|
76
|
+ public TaiHeRealController(IMediator mediator, ILogger<TaiHeRealController> logger)
|
|
77
|
+ {
|
|
78
|
+ _mediator = mediator;
|
|
79
|
+ _logger = logger;
|
|
80
|
+ }
|
|
81
|
+
|
|
82
|
+ /// <summary>
|
|
83
|
+ /// 场景执行
|
|
84
|
+ /// </summary>
|
|
85
|
+ /// <param name="extra"></param>
|
|
86
|
+ /// <returns></returns>
|
|
87
|
+ [HttpGet("cj/{extra}")]
|
|
88
|
+ public async Task<IActionResult> cj(string extra)
|
|
89
|
+ {
|
|
90
|
+ //rlq_nuode,SceneId,SceneScheduleId
|
|
91
|
+ string[] tempArr = extra.Split(',');
|
|
92
|
+
|
|
93
|
+ var innerCommand = new AutoTriggerSceneCommand
|
|
94
|
+ {
|
|
95
|
+ SceneId = tempArr[1],
|
|
96
|
+ SceneScheudleId = tempArr[2],
|
|
97
|
+ ConnKey=tempArr[0]
|
|
98
|
+ };
|
|
99
|
+
|
|
100
|
+ _logger.LogWarning($"正在触发场景:{extra}{WarningConstants.LogPlaceholder}", WarningConstants.LogTest);
|
|
101
|
+
|
|
102
|
+ await _mediator.Send(innerCommand);
|
|
103
|
+ return Ok();
|
|
104
|
+ }
|
|
105
|
+
|
|
106
|
+ }
|
|
107
|
+}
|
|
108
|
+```
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+定义一个`IJob`
|
|
112
|
+```
|
|
113
|
+namespace DD.Libs.TasksManager
|
|
114
|
+{
|
|
115
|
+ public class SceneJob : IJob
|
|
116
|
+ {
|
|
117
|
+ private readonly IOptions<JobSetting> _settings;
|
|
118
|
+
|
|
119
|
+ public SceneJob(IOptions<JobSetting> settings)
|
|
120
|
+ {
|
|
121
|
+ _settings = settings;
|
|
122
|
+ }
|
|
123
|
+ public async Task Execute(IJobExecutionContext context)
|
|
124
|
+ {
|
|
125
|
+ //获取job上下文中传来的额外参数
|
|
126
|
+ string extra = context.JobDetail.JobDataMap.GetString("extra");
|
|
127
|
+
|
|
128
|
+ using(var client = new HttpClient())
|
|
129
|
+ {
|
|
130
|
+ client.Timeout = TimeSpan.FromSeconds(1200);
|
|
131
|
+ //"http://47.103.61.198:5002/api/tasks/cj/
|
|
132
|
+ string url = $"{_settings.Value.sceneUrl }{extra}";
|
|
133
|
+ await client.GetAsync(url);
|
|
134
|
+ }
|
|
135
|
+ }
|
|
136
|
+ }
|
|
137
|
+}
|
|
138
|
+```
|
|
139
|
+
|
|
140
|
+在`Startup`中注册:
|
|
141
|
+```
|
|
142
|
+#region 场景定时任务,Quartz
|
|
143
|
+services.Configure<JobSetting>(Configuration.GetSection("Tasks"));
|
|
144
|
+services.AddTransient<SceneJob>();
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+NameValueCollection props = new NameValueCollection {
|
|
148
|
+ { "quartz.threadPool.threadCount","100"},
|
|
149
|
+ { "quartz.jobStore.type","Quartz.Impl.AdoJobStore.JobStoreTX, Quartz"},
|
|
150
|
+ { "quartz.jobStore.driverDelegateType","Quartz.Impl.AdoJobStore.StdAdoDelegate, Quartz"},
|
|
151
|
+ { "quartz.jobStore.dataSource","myDS"},
|
|
152
|
+ { "quartz.dataSource.myDS.connectionString",$"Server={Configuration["Tasks:server"]};{Configuration["Tasks:quartz"]}"},
|
|
153
|
+ //{ "quartz.dataSource.myDS.connectionString",$"server={Configuration["App:redis"]};port=3306;database=quartznet;user=root;password=lcDb_!@34%^_Mantunsci;SslMode=none"},
|
|
154
|
+ { "quartz.dataSource.myDS.provider","MySql"},
|
|
155
|
+ { "quartz.serializer.type","json"}
|
|
156
|
+ //{ "quartz.jobStore.useProperties","true"}
|
|
157
|
+ };
|
|
158
|
+
|
|
159
|
+//计划工厂
|
|
160
|
+var schedulerFactory = new StdSchedulerFactory(props);
|
|
161
|
+services.AddSingleton<ISchedulerFactory>(schedulerFactory); //计划工厂
|
|
162
|
+
|
|
163
|
+//job工厂
|
|
164
|
+services.AddSingleton<IJobFactory, SimpleInjectorJobFactory>();//Job工厂
|
|
165
|
+
|
|
166
|
+//帮助类
|
|
167
|
+services.AddSingleton<DDJobScheduler>((ctx) => {
|
|
168
|
+
|
|
169
|
+ var tempSchedulerFactory = ctx.GetRequiredService<ISchedulerFactory>();
|
|
170
|
+ var tempJobFactory = ctx.GetRequiredService<IJobFactory>();
|
|
171
|
+
|
|
172
|
+ var tempScheduler = tempSchedulerFactory.GetScheduler().Result;
|
|
173
|
+ tempScheduler.JobFactory = tempJobFactory;
|
|
174
|
+ var tempJobScheduler = new DDJobScheduler(tempScheduler);
|
|
175
|
+ return tempJobScheduler;
|
|
176
|
+
|
|
177
|
+});
|
|
178
|
+#endregion
|
|
179
|
+```
|
|
180
|
+
|
|
181
|
+在请求管道中注册:
|
|
182
|
+```
|
|
183
|
+#region 场景定时任务
|
|
184
|
+var scheduler = serviceProvider.GetService<DDJobScheduler>();
|
|
185
|
+scheduler.Init();
|
|
186
|
+#endregion
|
|
187
|
+```
|
|
188
|
+
|
|
189
|
+如何使用呢?
|
|
190
|
+```
|
|
191
|
+public class AddSceneSchedulesCommandHandler : IRequestHandler<AddSceneSchedulesCommand, ResponseWrapperBase>
|
|
192
|
+{
|
|
193
|
+
|
|
194
|
+ private readonly DDJobScheduler _scheduler;
|
|
195
|
+
|
|
196
|
+ public AddSceneSchedulesCommandHandler(DDJobScheduler scheduler)
|
|
197
|
+ {
|
|
198
|
+ _scheduler = scheduler;
|
|
199
|
+ }
|
|
200
|
+ public async Task<ResponseWrapperBase> Handle(AddSceneSchedulesCommand request, CancellationToken cancellationToken)
|
|
201
|
+ {
|
|
202
|
+ await _scheduler.DeleteJob(delJoinName, delGroupName);
|
|
203
|
+ string cron = JobUtil.GetCronByTime(newSceneSchedule.Hour, newSceneSchedule.Minute, newSceneSchedule.Second, (TimingWeekEnum)newSceneSchedule.Week);
|
|
204
|
+ await _scheduler.AddSceneJob(joinName, groupName, cron, joinName);
|
|
205
|
+
|
|
206
|
+ return await Task.FromResult(result);
|
|
207
|
+ }
|
|
208
|
+
|
|
209
|
+```
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+# 调用极光
|
|
213
|
+
|
|
214
|
+- 确定别名
|
|
215
|
+- 往数据库的Noti存入一条记录
|
|
216
|
+```
|
|
217
|
+对应的领域模型是:
|
|
218
|
+
|
|
219
|
+/// <summary>
|
|
220
|
+/// 通知
|
|
221
|
+/// </summary>
|
|
222
|
+public class Noti : Entity<Guid>, IAggregateRoot
|
|
223
|
+{
|
|
224
|
+ /// <summary>
|
|
225
|
+ /// 通知标题
|
|
226
|
+ /// </summary>
|
|
227
|
+ public string Title { get; private set; }
|
|
228
|
+ /// <summary>
|
|
229
|
+ /// 通知内容
|
|
230
|
+ /// </summary>
|
|
231
|
+ public string Content { get; private set; }
|
|
232
|
+ /// <summary>
|
|
233
|
+ /// 是否已读
|
|
234
|
+ /// </summary>
|
|
235
|
+ public string IsRead { get;private set; }
|
|
236
|
+
|
|
237
|
+ /// <summary>
|
|
238
|
+ /// 通知类型
|
|
239
|
+ /// 报警通知的Type=0
|
|
240
|
+ /// 延迟断电通知的Type=alert
|
|
241
|
+ /// </summary>
|
|
242
|
+ public string Type { get; private set; }
|
|
243
|
+
|
|
244
|
+ /// <summary>
|
|
245
|
+ /// 报警通知用的报警级别描述
|
|
246
|
+ /// </summary>
|
|
247
|
+ public string Level { get; private set; }
|
|
248
|
+
|
|
249
|
+ /// <summary>
|
|
250
|
+ /// 传递的主键
|
|
251
|
+ /// 用来点击某个通知跳转到某个地方
|
|
252
|
+ /// </summary>
|
|
253
|
+ public string ExtraId { get; private set; }
|
|
254
|
+
|
|
255
|
+ /// <summary>
|
|
256
|
+ /// 创建方式1
|
|
257
|
+ /// </summary>
|
|
258
|
+ /// <param name="title"></param>
|
|
259
|
+ /// <param name="content"></param>
|
|
260
|
+ public Noti(string title, string content)
|
|
261
|
+ {
|
|
262
|
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException("title cannot be null");
|
|
263
|
+ if (string.IsNullOrEmpty(content)) throw new ArgumentNullException("content cannot be null");
|
|
264
|
+
|
|
265
|
+ Title = title;
|
|
266
|
+ Content = content;
|
|
267
|
+
|
|
268
|
+ CreateTime = DateTime.Now.ToFullTimeStr();
|
|
269
|
+ Id = Guid.NewGuid();
|
|
270
|
+ LastUpdateTime = DateTime.Now.ToFullTimeStr();
|
|
271
|
+ IsLogicDel = CommonConstants.LogicDelNo;
|
|
272
|
+ }
|
|
273
|
+
|
|
274
|
+ /// <summary>
|
|
275
|
+ /// 创建方式2
|
|
276
|
+ /// </summary>
|
|
277
|
+ /// <param name="title"></param>
|
|
278
|
+ /// <param name="content"></param>
|
|
279
|
+ /// <param name="type"></param>
|
|
280
|
+ /// <param name="extraId"></param>
|
|
281
|
+ public Noti(string title, string content, string type, string extraId)
|
|
282
|
+ {
|
|
283
|
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException("title cannot be null");
|
|
284
|
+ if (string.IsNullOrEmpty(content)) throw new ArgumentNullException("content cannot be null");
|
|
285
|
+ if (string.IsNullOrEmpty(extraId)) throw new ArgumentNullException("extraId cannot be null");
|
|
286
|
+
|
|
287
|
+ Title = title;
|
|
288
|
+ Content = content;
|
|
289
|
+ Type = type;
|
|
290
|
+ ExtraId = extraId;
|
|
291
|
+
|
|
292
|
+ CreateTime = DateTime.Now.ToFullTimeStr();
|
|
293
|
+ Id = Guid.NewGuid();
|
|
294
|
+ LastUpdateTime = DateTime.Now.ToFullTimeStr();
|
|
295
|
+ IsLogicDel = CommonConstants.LogicDelNo;
|
|
296
|
+ }
|
|
297
|
+
|
|
298
|
+ /// <summary>
|
|
299
|
+ /// 设置报警级别
|
|
300
|
+ /// </summary>
|
|
301
|
+ /// <param name="level"></param>
|
|
302
|
+ public void SetLevel(string level)
|
|
303
|
+ {
|
|
304
|
+ Level = level;
|
|
305
|
+ }
|
|
306
|
+
|
|
307
|
+ /// <summary>
|
|
308
|
+ /// 标记已读
|
|
309
|
+ /// </summary>
|
|
310
|
+ /// <param name="regId"></param>
|
|
311
|
+ public void MarkRead(string regId)
|
|
312
|
+ {
|
|
313
|
+ if (string.IsNullOrEmpty(regId)) throw new ArgumentNullException("title cannot be null");
|
|
314
|
+
|
|
315
|
+ if(string.IsNullOrEmpty(IsRead))
|
|
316
|
+ {
|
|
317
|
+ IsRead = regId;
|
|
318
|
+ }
|
|
319
|
+ else
|
|
320
|
+ {
|
|
321
|
+ var currentRegIds = regId.Split(',').ToList();
|
|
322
|
+ currentRegIds.Add(regId);
|
|
323
|
+ IsRead = string.Join(',', currentRegIds);
|
|
324
|
+ }
|
|
325
|
+ }
|
|
326
|
+}
|
|
327
|
+
|
|
328
|
+//对应的仓储
|
|
329
|
+private readonly INotiRepository _notiRepo;
|
|
330
|
+
|
|
331
|
+public SomeRequestHandler(INotiRepository notiRepo)
|
|
332
|
+{
|
|
333
|
+ _notiRepo = notiRepo;
|
|
334
|
+}
|
|
335
|
+
|
|
336
|
+
|
|
337
|
+//大致用法
|
|
338
|
+var newNoti = new Noti("title","content", "alert", string.Empty);
|
|
339
|
+_notiRepo.Add(newNoti);
|
|
340
|
+await _notiRepo.UnitOfWork.SaveChangesAsync(cancellationToken);
|
|
341
|
+
|
|
342
|
+```
|
|
343
|
+- 极光推送
|
|
344
|
+```
|
|
345
|
+var request = new JiGuanPushRequest
|
|
346
|
+ {
|
|
347
|
+ platform = "all",
|
|
348
|
+ //audience = "all",//针对所有
|
|
349
|
+ audience = new Audience
|
|
350
|
+ {
|
|
351
|
+ alias = tempAlias
|
|
352
|
+ },
|
|
353
|
+ notification = new Notification
|
|
354
|
+ {
|
|
355
|
+ alert = $"{locationDesc},{kgDesc},{warningDesc}",
|
|
356
|
+ android = new Android
|
|
357
|
+ {
|
|
358
|
+ extras = new Extras
|
|
359
|
+ {
|
|
360
|
+ android_key1 = string.Empty,
|
|
361
|
+ kaiGuanId = cloudKaiGuan.Id.ToString(),
|
|
362
|
+ connKey = cloudKaiGuan.ConnKey,
|
|
363
|
+ startTime = startEndTime,
|
|
364
|
+ warningType = ((short)type).ToString(),
|
|
365
|
+ projectId = _appOptions.Value.projectid,
|
|
366
|
+ notiType = "0", //通知消息类型
|
|
367
|
+ notiId = notis.Id.ToString()
|
|
368
|
+ }
|
|
369
|
+ },
|
|
370
|
+ ios = new Ios
|
|
371
|
+ {
|
|
372
|
+ sound = "sound.caf",
|
|
373
|
+ badge = "+1",
|
|
374
|
+ extras = new Extras2
|
|
375
|
+ {
|
|
376
|
+ ios_key1 = string.Empty,
|
|
377
|
+ kaiGuanId = cloudKaiGuan.Id.ToString(),
|
|
378
|
+ connKey = cloudKaiGuan.ConnKey,
|
|
379
|
+ startTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
380
|
+ warningType = ((short)type).ToString(),
|
|
381
|
+ projectId = _appOptions.Value.projectid,
|
|
382
|
+ notiType = "0", //通知消息类型
|
|
383
|
+ notiId = notis.Id.ToString()
|
|
384
|
+ }
|
|
385
|
+ }
|
|
386
|
+ },
|
|
387
|
+ options = new JiGuangs.Options
|
|
388
|
+ {
|
|
389
|
+ apns_production = true
|
|
390
|
+ }
|
|
391
|
+ };
|
|
392
|
+
|
|
393
|
+ var response = await _appOptions.Value.jiguang
|
|
394
|
+ .WithHeader("Content-Type", "application/json")
|
|
395
|
+ .WithHeader("Authorization", "Basic M2ZhOTE0NTUzNmEwMDFmY2UwYjg3NjU5OjIxYjE0ZGM0OGZkZjRmMDk4NzZiMTg0MQ==")
|
|
396
|
+ .PostJsonAsync(request);
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+//相关Dto
|
|
400
|
+ public class JiGuanPushRequest
|
|
401
|
+ {
|
|
402
|
+ [JsonProperty("platform")]
|
|
403
|
+ public string platform { get; set; }
|
|
404
|
+
|
|
405
|
+ //[JsonProperty("audience")]
|
|
406
|
+ //public string audience { get; set; }
|
|
407
|
+
|
|
408
|
+ [JsonProperty("audience")]
|
|
409
|
+ public Audience audience { get; set; }
|
|
410
|
+
|
|
411
|
+ [JsonProperty("notification")]
|
|
412
|
+ public Notification notification { get; set; }
|
|
413
|
+
|
|
414
|
+ [JsonProperty("options")]
|
|
415
|
+ public Options options { get; set; }
|
|
416
|
+ }
|
|
417
|
+
|
|
418
|
+ public class Audience
|
|
419
|
+ {
|
|
420
|
+ [JsonProperty("alias")]
|
|
421
|
+ public List<string> alias { get; set; } = new List<string>();
|
|
422
|
+ }
|
|
423
|
+
|
|
424
|
+ public class Android
|
|
425
|
+ {
|
|
426
|
+ [JsonProperty("extras")]
|
|
427
|
+ public Extras extras { get; set; }
|
|
428
|
+ }
|
|
429
|
+
|
|
430
|
+ public class Extras
|
|
431
|
+ {
|
|
432
|
+ [JsonProperty("android-key1")]
|
|
433
|
+ public string android_key1 { get; set; }
|
|
434
|
+
|
|
435
|
+ [JsonProperty("kaiGuanId")]
|
|
436
|
+ public string kaiGuanId { get; set; }
|
|
437
|
+
|
|
438
|
+ [JsonProperty("warningType")]
|
|
439
|
+ public string warningType { get; set; }
|
|
440
|
+
|
|
441
|
+ [JsonProperty("startTime")]
|
|
442
|
+ public string startTime { get; set; }
|
|
443
|
+
|
|
444
|
+ [JsonProperty("connKey")]
|
|
445
|
+ public string connKey { get; set; }
|
|
446
|
+
|
|
447
|
+ [JsonProperty("notiType")]
|
|
448
|
+ public string notiType { get; set; }
|
|
449
|
+
|
|
450
|
+ [JsonProperty("projectId")]
|
|
451
|
+ public string projectId { get; set; }
|
|
452
|
+
|
|
453
|
+ [JsonProperty("notiId")]
|
|
454
|
+ public string notiId { get; set; }
|
|
455
|
+ }
|
|
456
|
+
|
|
457
|
+ public class Extras2
|
|
458
|
+ {
|
|
459
|
+ [JsonProperty("ios-key1")]
|
|
460
|
+ public string ios_key1 { get; set; }
|
|
461
|
+ [JsonProperty("kaiGuanId")]
|
|
462
|
+ public string kaiGuanId { get; set; }
|
|
463
|
+
|
|
464
|
+ [JsonProperty("warningType")]
|
|
465
|
+ public string warningType { get; set; }
|
|
466
|
+
|
|
467
|
+ [JsonProperty("startTime")]
|
|
468
|
+ public string startTime { get; set; }
|
|
469
|
+
|
|
470
|
+ [JsonProperty("connKey")]
|
|
471
|
+ public string connKey { get; set; }
|
|
472
|
+
|
|
473
|
+ [JsonProperty("notiType")]
|
|
474
|
+ public string notiType { get; set; }
|
|
475
|
+
|
|
476
|
+ [JsonProperty("projectId")]
|
|
477
|
+ public string projectId { get; set; }
|
|
478
|
+
|
|
479
|
+ [JsonProperty("notiId")]
|
|
480
|
+ public string notiId { get; set; }
|
|
481
|
+ }
|
|
482
|
+
|
|
483
|
+ public class Ios
|
|
484
|
+ {
|
|
485
|
+ [JsonProperty("sound")]
|
|
486
|
+ public string sound { get; set; }
|
|
487
|
+
|
|
488
|
+ [JsonProperty("badge")]
|
|
489
|
+ public string badge { get; set; }
|
|
490
|
+
|
|
491
|
+ [JsonProperty("extras")]
|
|
492
|
+ public Extras2 extras { get; set; }
|
|
493
|
+ }
|
|
494
|
+
|
|
495
|
+ public class Notification
|
|
496
|
+ {
|
|
497
|
+ [JsonProperty("alert")]
|
|
498
|
+ public string alert { get; set; }
|
|
499
|
+
|
|
500
|
+ [JsonProperty("android")]
|
|
501
|
+ public Android android { get; set; }
|
|
502
|
+
|
|
503
|
+ [JsonProperty("ios")]
|
|
504
|
+ public Ios ios { get; set; }
|
|
505
|
+ }
|
|
506
|
+
|
|
507
|
+ public class Options
|
|
508
|
+ {
|
|
509
|
+ [JsonProperty("apns_production")]
|
|
510
|
+ public bool apns_production { get; set; }
|
|
511
|
+ }
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+ public class TempRegIdsAndAlias
|
|
515
|
+ {
|
|
516
|
+ public string RegId { get; set; }
|
|
517
|
+ public string Alias { get; set; }
|
|
518
|
+ }
|
|
519
|
+```
|