|
@ -1,7 +1,11 @@ |
|
|
using BCS.BMC.Controllers; |
|
|
|
|
|
|
|
|
using Abp.Json; |
|
|
|
|
|
using BCS.BMC.Controllers; |
|
|
using BCS.BMC.FirebaseCloudMessaging; |
|
|
using BCS.BMC.FirebaseCloudMessaging; |
|
|
|
|
|
using BCS.BMC.FirebaseCloudMessaging.Dto; |
|
|
|
|
|
using BCS.BMC.Models.TokenAuth; |
|
|
using FirebaseAdmin.Messaging; |
|
|
using FirebaseAdmin.Messaging; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
|
|
using Newtonsoft.Json; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
|
|
|
|
|
@ -20,10 +24,11 @@ namespace BCS.BMC.Web.Controllers |
|
|
|
|
|
|
|
|
[Route("send")] |
|
|
[Route("send")] |
|
|
[HttpPost] |
|
|
[HttpPost] |
|
|
public async Task<IActionResult> Notification(string fcmToken, [FromBody] Notification notification) |
|
|
|
|
|
|
|
|
public async Task<IActionResult> Notification( [FromBody] FireBaseResponseModel notification) |
|
|
{ |
|
|
{ |
|
|
var result = await FirebaseNotificationAppService.SendNotification(fcmToken, notification); |
|
|
|
|
|
return Ok(result); |
|
|
|
|
|
|
|
|
var result = await FirebaseNotificationAppService.SendNotification(notification); |
|
|
|
|
|
// FcmTokenResponseModel results = JsonConvert.DeserializeObject<FcmTokenResponseModel>(result).ToJsonString();
|
|
|
|
|
|
return Ok(result.Responses); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |