public async Task SendNotificationAsync(NotificationSchedulerItem item) { var alert = "{\"aps\":{\"alert\":\"" + item.Text + "\",\"sound\":\"default\"}}"; await Program.NotificationClient.SendAppleNativeNotificationAsync(alert); }
public ActionResult ScheduleNotification(NotificationSchedulerItem item) { BackgroundJob.Schedule(() => SendNotificationAsync(item), TimeSpan.FromSeconds(item.Time)); return(Content("Scheduled notification")); }