private async Task SendMeetupsNotifications(AuditXmlUpdate auditUpdate) { foreach (var meetup in auditUpdate.Meetups.Where(meetup => meetup.Sessions.First().StartTime > DateTime.Now)) { var pushContent = new PushContent() { Title = $"{meetup.Name} is announced!", Body = "Open DotNetRu app for details" }; await pushNotificationsManager.SendPushNotifications(pushContent); } }
public async Task <IActionResult> Run([FromBody] PushContent pushContent) { try { await pushNotificationsManager.SendPushNotifications(pushContent); } catch (Exception e) { logger.LogCritical(e, "Error while sending push notifications"); return(new ObjectResult(e.Message) { StatusCode = StatusCodes.Status500InternalServerError }); } return(new OkResult()); }