Exemplo n.º 1
0
        public Guid Subscribe(Action <Notification> OnReceiveNotification, string tag)
        {
            if (_messenger.HasSubscriptionsForTag <NotificationMessage>(tag))
            {
                return(Guid.Empty);
            }

            var subscription = _messenger.SubscribeOnMainThread <NotificationMessage>((msg) =>
            {
                OnReceiveNotification(msg.Notification);
            }, MvxReference.Strong);

            _subscriptionToken.Add(subscription.Id, subscription);

            return(subscription.Id);
        }