Example #1
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);
 }
Example #2
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);
        }
Example #3
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);
        }
Example #4
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);
        }
Example #5
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);
            }
        }
Example #6
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);
            }
        }
Example #7
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);
            }
        }
Example #8
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);
            }
        }