private async Task FetchChannelMessages(OpenChannel channel)
        {
            var tcs = new TaskCompletionSource <SendBirdException>();

            var prevMessageListQuery = channel.CreatePreviousMessageListQuery();

            prevMessageListQuery.Load(30, false, (messages, ex) =>
            {
                HandleMessages(messages);
                tcs.SetResult(ex);
            });

            HandleException(await tcs.Task);
        }
Пример #2
0
    public void GetPreviousOpenChannelData()
    {
        PreviousMessageListQuery mPrevMessageListQuery = _openChannel.CreatePreviousMessageListQuery();

        mPrevMessageListQuery.Load(30, true, (List <BaseMessage> messages, SendBirdException e) =>
        {
            if (e != null)
            {
                // Error.
                return;
            }
            blogHistrory = messages;
        });
    }