public void Queue(DtoIOSNotification msg) { lock (_updateLock) { if (_iosPushСhannels.ContainsKey(msg.MobileAppId)) { // new ApnsNotification(). _iosPushСhannels[msg.MobileAppId].IncomingQueue.Enqueue(new ApnsNotification(msg.Token, JObject.Parse(msg.Payload))); } } }
public IHttpActionResult SendPush([FromBody] DtoIOSNotification msg) { var expiredToken = TokenExperation.CheckExpired(msg.Token); if (expiredToken != null) { return(Ok(new DtoPushNotificationResponse() { Expired = new[] { DtoExpiredToken.FromDataModel(expiredToken) } })); } Service.Queue(msg); return(Ok(new DtoPushNotificationResponse() { Expired = null })); }