예제 #1
0
        /// <summary>
        /// Creates a subscriber to receive push notifications.
        /// </summary>
        /// <param name = "handler">specify the handler of the notifications</param>
        /// <param name = "handlerInstructions">map of instructions for the handler</param>
        /// <returns>n  otification subscriber</returns>
        public Task <Subscriber> SubscribeToNotifications(
            string handler,
            MapField <string, string> handlerInstructions)
        {
            var request = new SubscribeToNotificationsRequest
            {
                Handler = handler
            };

            request.HandlerInstructions.Add(handlerInstructions);
            return(gateway(authenticationContext())
                   .SubscribeToNotificationsAsync(request)
                   .ToTask(response =>
                           response.Subscriber));
        }
 private void AddSubscriber(SubscribeToNotificationsRequest m)
 {
     _subscribers.Add(Sender);
     Sender.Tell(new SubscribeToNotificationsResponse(m.CorrelationId));
 }