Beispiel #1
0
        public void sendRefresh(int peopleID, int type)
        {
            GCMData    data = new GCMData(type, ACTION_REFRESH, 0, "", "");
            GCMMessage msg  = new GCMMessage(peopleID, null, data, null, _host, _dataContext);

            send(msg);
        }
Beispiel #2
0
 public static void sendNotification(int peopleID, int type, int id, string title, string message)
 {
     GCMPayload notification = new GCMPayload(title, message);
     GCMData data = new GCMData(type, ACTION_REFRESH_AND_NOTIFY, id, title, message);
     GCMMessage msg = new GCMMessage(peopleID, null, data, notification);
     send(msg);
 }
Beispiel #3
0
        public static void sendRefresh(List<int> peopleIDs, int type)
        {
            if (peopleIDs.Count == 0) return;

            GCMData data = new GCMData(type, ACTION_REFRESH, 0, "", "");
            GCMMessage msg = new GCMMessage(peopleIDs, null, data, null);
            send(msg);
        }
Beispiel #4
0
        public void sendNotification(int peopleID, int type, int id, string title, string message)
        {
            GCMPayload notification = new GCMPayload(title, message);
            GCMData    data         = new GCMData(type, ACTION_REFRESH_AND_NOTIFY, id, title, message);
            GCMMessage msg          = new GCMMessage(peopleID, null, data, notification, _host, _dataContext);

            send(msg);
        }
Beispiel #5
0
        public static void sendNotification(List<int> peopleIDs, int type, int id, string title, string message)
        {
            if (peopleIDs.Count == 0) return;

            GCMPayload notification = new GCMPayload(title, message);
            GCMData data = new GCMData(type, ACTION_REFRESH_AND_NOTIFY, id, title, message);
            GCMMessage msg = new GCMMessage(peopleIDs, null, data, notification);
            send(msg);
        }
Beispiel #6
0
        public void sendRefresh(List <int> peopleIDs, int type)
        {
            if (peopleIDs.Count == 0)
            {
                return;
            }

            GCMData    data = new GCMData(type, ACTION_REFRESH, 0, "", "");
            GCMMessage msg  = new GCMMessage(peopleIDs, null, data, null, _host, _dataContext);

            send(msg);
        }
Beispiel #7
0
        public void sendNotification(List <int> peopleIDs, int type, int id, string title, string message)
        {
            if (peopleIDs.Count == 0)
            {
                return;
            }

            GCMPayload notification = new GCMPayload(title, message);
            GCMData    data         = new GCMData(type, ACTION_REFRESH_AND_NOTIFY, id, title, message);
            GCMMessage msg          = new GCMMessage(peopleIDs, null, data, notification, _host, _dataContext);

            send(msg);
        }
Beispiel #8
0
        public GCMMessage(int peopleID, string exclude, GCMData data, GCMPayload notification)
        {
            this.data         = data;
            this.notification = notification;

            this.registration_ids = (from r in DbUtil.Db.MobileAppPushRegistrations
                                     where r.PeopleId == peopleID
                                     select r.RegistrationId).ToList();

            if (exclude != null && exclude.Length > 0)
            {
                this.registration_ids.Remove(exclude);
            }
        }
Beispiel #9
0
        public GCMMessage(int peopleID, string exclude, GCMData data, GCMPayload notification)
        {
            this.data = data;
            this.notification = notification;

            this.registration_ids = (from r in DbUtil.Db.MobileAppPushRegistrations
                                     where r.PeopleId == peopleID
                                     select r.RegistrationId).ToList();

            if (exclude != null && exclude.Length > 0)
            {
                this.registration_ids.Remove(exclude);
            }
        }
Beispiel #10
0
        public GCMMessage(List <int> peopleIDs, string exclude, GCMData data, GCMPayload notification)
        {
            if (!Util.Host.HasValue())
            {
                return;
            }
            this.data         = data;
            this.notification = notification;

            this.registration_ids = (from r in DbUtil.Db.MobileAppPushRegistrations
                                     where peopleIDs.Contains(r.PeopleId)
                                     select r.RegistrationId).ToList();

            if (exclude != null && exclude.Length > 0)
            {
                this.registration_ids.Remove(exclude);
            }
        }
Beispiel #11
0
        public GCMMessage(int peopleID, string exclude, GCMData data, GCMPayload notification, string host, CMSDataContext dataContext)
        {
            _host        = host;
            _dataContext = dataContext;

            if (!_host.HasValue())
            {
                return;
            }

            this.data         = data;
            this.notification = notification;

            this.registration_ids = (from r in _dataContext.MobileAppPushRegistrations
                                     where r.PeopleId == peopleID
                                     select r.RegistrationId).ToList();

            if (exclude != null && exclude.Length > 0)
            {
                this.registration_ids.Remove(exclude);
            }
        }
Beispiel #12
0
 public GCMMessage(List <string> registrationIDs, GCMData data)
 {
     this.registration_ids = registrationIDs;
     this.data             = data;
 }
Beispiel #13
0
 public static void sendRefresh(int peopleID, int type)
 {
     GCMData data = new GCMData(type, ACTION_REFRESH, 0, "", "");
     GCMMessage msg = new GCMMessage(peopleID, null, data, null);
     send(msg);
 }
Beispiel #14
0
 public GCMMessage(List<string> registrationIDs, GCMData data)
 {
     this.registration_ids = registrationIDs;
     this.data = data;
 }