public bool PushNotification(Device device, JSONNotification notification) { // Check if gcm looks is valid if (!String.IsNullOrEmpty(device.GCM) && !String.IsNullOrWhiteSpace(device.GCM)) { try { GcmNotification notif = new GcmNotification().ForDeviceRegistrationId(device.GCM).WithJson(JsonConvert.SerializeObject(notification)); _push.QueueNotification(notif); return true; } catch (Exception e) { return false; } } else { return false; } }
public bool PushNotification(Device device, JSONNotification notification) { // Check if gcm looks is valid if (!String.IsNullOrEmpty(device.GCM) && !String.IsNullOrWhiteSpace(device.GCM)) { try { GcmNotification notif = new GcmNotification().ForDeviceRegistrationId(device.GCM).WithJson(JsonConvert.SerializeObject(notification)); _push.QueueNotification(notif); return(true); } catch (Exception e) { return(false); } } else { return(false); } }
public bool PushTestNotification(Device device) { JSONNotification notification = new JSONNotification("IcyTestNotification", _compName, ""); return PushNotification(device, notification); }
public bool PushTestNotification(Device device) { JSONNotification notification = new JSONNotification("IcyTestNotification", _compName, ""); return(PushNotification(device, notification)); }