public void Apply(FirebaseTokenAdded evt)
        {
            var ft = new FirebaseTokenAndNotificationTypeId(evt.FirebaseToken, evt.NotificationTypeId);

            if (_firebaseTokenAndNotificationTypeIds.Contains(ft) == false)
            {
                _firebaseTokenAndNotificationTypeIds.Add(ft);
            }
        }
        public void RemoveToken(string fireBaseToken, string notificationTypeId)
        {
            var ft = new FirebaseTokenAndNotificationTypeId(fireBaseToken, notificationTypeId);

            if (_firebaseTokenAndNotificationTypeIds.Contains(ft))
            {
                var evt = new FirebaseTokenRemoved(PersonalNumber, fireBaseToken, notificationTypeId);
                Publish(evt);
            }
        }
        public void AddToken(string fireBaseToke, string notificationTypeId)
        {
            var ft = new FirebaseTokenAndNotificationTypeId(fireBaseToke, notificationTypeId);

            if (_firebaseTokenAndNotificationTypeIds.Contains(ft) == false)
            {
                var evt = new FirebaseTokenAdded(PersonalNumber, fireBaseToke, notificationTypeId);
                Publish(evt);
            }
        }
        public void Apply(IFirebaseTokenRemoved evt)
        {
            var ft = new FirebaseTokenAndNotificationTypeId(evt.FirebaseToken, evt.NotificationTypeId);

            _firebaseTokenAndNotificationTypeIds.RemoveAll(t => t.Equals(ft));
        }
Exemple #5
0
 protected bool Equals(FirebaseTokenAndNotificationTypeId other)
 {
     return(string.Equals(FirebaseToken, other.FirebaseToken) && string.Equals(NotificationTypeId, other.NotificationTypeId));
 }