メニュー

Expand
ページを評価:

Chat Client SDKでの結果のページング

Programmable Chat will no longer be available or supported after July 25, 2022. Instead, we'll be focusing on the next generation of chat: Twilio Conversations. Find out more about the EOL process here.

If you're starting a new project, please visit the Conversations Docs to begin. If you've already built on Programmable Chat, please visit our Migration Guide to learn about how to switch.

Twilio’s Programmable Chat client SDKs use paging to improve performance when accessing potentially large collections of chat objects.

Paginators

Public Channels, User Channels, and the Members list for each channel are exposed through Paginators. In JavaScript, Messages are also paged using Paginators. When requesting an initial set of any of these entities, your provided callback mechanism will receive a result indicating the success or failure of the operation as well as a paginator to access the items.

While the signature of the individual methods will vary by SDK platform, each paginator has the following accessors:

  • A way to obtain the items.
  • A boolean property indicating if there are subsequent pages.
  • A method taking the same callback mechanism as the original call to request the next page.
        
        
        

        Messages (Android, iOS)

        The messages collection behaves a bit differently than channels and members since there is a temporal quality to how the objects are typically presented.

        The messages collection objects offer the following ways to access items:

        • getLastMessages fetches the specified number of messages, starting with the most recent in the collection.
        • getMessagesBefore fetches messages before (and including) the anchor message index specified.
        • getMessagesAfter fetches messages after (and including) the anchor message index specified.
        • messageWithConsumptionIndex fetches the message with the specified index or, if that message is no longer available, the message directly before it.
        • messageWithIndex fetches the message specified by the index, if available.
              
              
              
              ページを評価:

              ヘルプが必要ですか?

              We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

                    
                    
                    

                    フィードバックくださりありがとうございます!

                    Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

                    Sending your feedback...
                    🎉 Thank you for your feedback!
                    Something went wrong. Please try again.

                    Thanks for your feedback!

                    Refer us and get $10 in 3 simple steps!

                    ステップ1

                    Get link

                    Get a free personal referral link here

                    ステップ2:

                    Give $10

                    Your user signs up and upgrade using link

                    ステップ3

                    Get $10

                    1,250 free SMSes
                    OR 1,000 free voice mins
                    OR 12,000 chats
                    OR more