コード例 #1
0
ファイル: Client.cs プロジェクト: Labs4Dev/sdk-csharp
        /// <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));
        }
コード例 #2
0
 private void AddSubscriber(SubscribeToNotificationsRequest m)
 {
     _subscribers.Add(Sender);
     Sender.Tell(new SubscribeToNotificationsResponse(m.CorrelationId));
 }