コード例 #1
0
 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;
     }
 }
コード例 #2
0
 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);
     }
 }
コード例 #3
0
 public bool PushTestNotification(Device device)
 {
     JSONNotification notification = new JSONNotification("IcyTestNotification", _compName, "");
     return PushNotification(device, notification);
 }
コード例 #4
0
    public bool PushTestNotification(Device device)
    {
        JSONNotification notification = new JSONNotification("IcyTestNotification", _compName, "");

        return(PushNotification(device, notification));
    }