/// <summary> /// Sets push notification information for the specified user token. /// </summary> /// <param name="userToken">The user token.</param> /// <param name="pushNotification">Push notification parameters.</param> public void SetupNotification(string userToken, PushNotification pushNotification) { var userStatePushNotification = new UserStatePushNotification { UserToken = userToken, NotificationToken = pushNotification.PushNotificationToken.Replace(" ", string.Empty).Trim(), NotificationTarget = pushNotification.PushNotificationTarget }; userRepository.SetPushNotification(userStatePushNotification); }
public void TestPushNotifications() { var repository = ServiceProvider.GetService <IUserRepository>(); var pushNotification = new UserStatePushNotification { UserToken = "userTokenForPushNotification", NotificationToken = "pushToken", NotificationTarget = "pushTarget" }; repository.SetPushNotification(pushNotification); Assert.That(repository.GetPushNotification("missing"), Is.Null); var actualPushNotification = repository.GetPushNotification(pushNotification.UserToken); Assert.That(actualPushNotification.NotificationToken, Is.EqualTo(pushNotification.NotificationToken)); Assert.That(actualPushNotification.NotificationTarget, Is.EqualTo(pushNotification.NotificationTarget)); }
public void SetPushNotification(UserStatePushNotification pushNotification) { mapper.Insert(pushNotification); }