Exemple #1
0
        /// <summary>
        /// Confirms receipt of messages by a client, cancels PUSH-notification sending.
        /// </summary>
        /// <param name="maxId">Maximum message ID available in a client.</param>
        /// <returns>The method returns the list of message IDs, for which PUSH-notifications were cancelled.</returns>
        /// TODO: interface?
        public async Task <TVector <TReceivedNotifyMessage> > ReceivedMessagesAsync(int maxId)
        {
            EnsureUserAuthorized();

            var receivedMessages = new RequestReceivedMessages
            {
                MaxId = maxId
            };

            return(await SenderService.SendRequestAsync(receivedMessages).ConfigureAwait(false));
        }
Exemple #2
0
        /// <summary>Confirms receipt of messages by a client, cancels PUSH-notification sending.</summary>
        /// <param name="maxId">Maximum message ID available in a client.</param>
        /// <returns>The method returns the list of message IDs, for which PUSH-notifications were cancelled.</returns>
        /// TODO: interface?
        public async Task <TVector <TReceivedNotifyMessage> > ReceivedMessagesAsync(int maxId, CancellationToken cancellationToken = default(CancellationToken))
        {
            AuthApiService.EnsureUserAuthorized();

            var receivedMessages = new RequestReceivedMessages
            {
                MaxId = maxId
            };

            return(await SenderService.SendRequestAsync(receivedMessages, cancellationToken).ConfigureAwait(false));
        }
        /// <inheritdoc />
        public async Task <IReadOnlyList <IReceivedNotifyMessage> > ReceivedMessagesAsync(int maxId, CancellationToken cancellationToken = default(CancellationToken))
        {
            ClientSettings.EnsureUserAuthorized();

            var receivedMessages = new RequestReceivedMessages
            {
                MaxId = maxId
            };

            var result = await RequestSender.SendRequestAsync(receivedMessages, cancellationToken).ConfigureAwait(false);

            return(result);
        }