Exemplo n.º 1
0
        public IHttpActionResult addGCMRegkey(string RegKey, string DeviceId)
        {
            //TODO if Token is differnet
            GCMRegKey aRegKey = gcmService.GetByDeviceID(DeviceId);
            if (aRegKey==null)
            {
                GCMRegKey aKey=new GCMRegKey();
                aKey.DeviceId = DeviceId;
                aKey.RegistrationToken = RegKey;
                aKey.RegisterdOn = DateTime.Now;
                gcmService.Add(aKey);

            }
            else if (aRegKey.RegistrationToken != RegKey)
            {
               aRegKey.RegistrationToken = RegKey;
               aRegKey.RegisterdOn = DateTime.Now;
               gcmService.Update(aRegKey);
            }
            return Ok("Key Added");
        }
Exemplo n.º 2
0
 public void Add(GCMRegKey aRegKey)
 {
     repository.Add(aRegKey);
 }
Exemplo n.º 3
0
 public void Update(GCMRegKey aRegKey)
 {
     repository.Update(aRegKey);
 }