Beispiel #1
0
        public SendPushNotificationResponse SendPushNotification(ISession session, SendPushNotificationRequest request)
        {
            var response = request.CreateResponse<SendPushNotificationResponse>();

            using (var uow = UnitOfWorkFactory.Create())
            {
                var user = uow.UsersRepository.FirstMatching(UserSpecification.Id(request.TargetId));
                if (user != null && !string.IsNullOrWhiteSpace(user.PushUri))
                {
                    response.IsReceived = _pushNotificator.Send(user.PushUri, string.Format("{0} invites you to online", session.User.Name));
                }
            }

            return response;
        }
		public Task<SendPushNotificationResponse> SendPushNotification(SendPushNotificationRequest request)
		{
			return ConnectionManager.SendRequestAndWaitResponse<SendPushNotificationResponse>(request);
		}