メニュー

Expand
ページを評価:

Event Handling

The Conversations SDK is event-driven. Objects from the SDK will emit real-time events based on state changes in your Conversations instance. You can use these events to update your application’s state and UI.

Which objects emit events?

The SDK emits events on several objects (i.e. Client, Conversation, User, etc.).

These events are emitted, for example, when:

  • A new Message is added to a Conversation that you are participating in
  • The connection state of your Client changes
  • A Participant leaves a Conversation
  • A User comes online
  • Your Access Token is about to expire
  • The friendlyName of a Conversation is updated

A full list of events and objects can be found by referring to our generated SDK documentation:

        
        
        

        Best practices and tips for listening to events

        • For the JavaScript SDK, you can receive most events from the Client object. This is more performant in browsers and recommended over setting up duplicate handlers on each Conversation/User. You can also set up handlers on specific objects (e.g. Conversation, User) as needed.
        • For the iOS SDK, all events are emitted at the top level ConversationsClientDelegate.
        • For the Android SDK, only some events are emitted from the ConversationsClientListener. Other events are available from the ConversationListener and MediaUploadListener.

        関連トピック

        As a next step, you can visit the following guides:

        ページを評価:

        ヘルプが必要ですか?

        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