public HttpResponseMessage Post(MessageModel messageObject) { var users = messageObject.users_keys; var message = messageObject.message; var jsonNotification = new IonicUserPush(); using (WebClient wc = new WebClient()) { wc.Headers[HttpRequestHeader.ContentType] = "application/json"; wc.Headers.Add("X-Ionic-Application-Id", NotificationsControllerSettings.IonicApplicationId); try { var response = wc.UploadString(new Uri("https://push.ionic.io/api/v1/push"), JsonConvert.SerializeObject(jsonNotification)); LogService.LogNotification(messageObject, jsonNotification); } catch (WebException e) { Console.WriteLine(e.Message); LogService.LogNotification(messageObject, e.Message); } catch (Exception e) { Console.WriteLine(e.Message); LogService.LogNotification(messageObject, e.Message); return null; } } return null; }
public static void LogNotification(MessageModel serverMessage, string specialMessage) { return; }
public static void LogNotification(MessageModel serverMessage, IonicUserPush ionicMessage) { return; }