A2P 10DLC Campaign Vetting Delays: Twilio cannot approve 10DLC Campaigns ourselves, and must rely on third parties who control our connections to carriers to sign off. These external processes are creating several week delays for our customers. We continue to escalate these issues and are working to reduce delays wherever possible. Further details will be shared in the Campaign Vetting Changes article as they become available.

Error handling in Twilio conversations iOS SDK with code example

We have provided the following diagnostics tips to help capture issues while using Twilio Conversations iOS SDK. These tips are also valuable in providing logs and details to Twilio Support.

TCHResult:

Most operations that can be performed on objects in Conversations for iOS return a TCHResult object to their completion block. This includes operations against Conversations, Messages, and Participants. 

This object contains an isSuccessful method as well as an error property which will be populated with an error, should the operation fail. Your application should check for this error and never disregard it. 

For more details, see our iOS Error Handling - Objective-C, Swift documentation.


conversation.SomeEvent(message) { tchResult in if let error = tchResult.error { self.delegate?.onSomeEventError(error) return

errorReceived:

For issues where the client could not be initialised,  the token update failed or registering for notifications failed, errorReceived can be used.

func conversationsClient(_ client: TwilioConversationsClient, errorReceived error: TCHError)..

This method will be called during client creation if any error occurs. If client initialization fails and a nil client is returned, this method will be called with an explanation of why the creation failed.

Connection events:

connectionStateUpdated events are emitted for the various connection states through the ConversationsClientDelegate

The connection states are a constant:

Possible values are as follows:

  • connecting - client is offline and connection attempt is in process
  • connected - client is online and ready
  • disconnecting - client is going offline as disconnection is in process
  • disconnected - client is offline and no connection attempt is in process
  • denied - client connection is denied because of invalid JWT access token. User must refresh token in order to proceed

disconnecting is a graceful disconnect meaning the SDK already knows that this is going to happen. On the other-hand,  'disconnected' means the client is simply offline and there is no connection in place, hence there is no attempt to connect. The disconnecting state can happen because of errors such as the client being not able to establish connection with the server due to various reasons such as Internet issues, a disconnection would happen as a result.

Have more questions? Submit a request
Powered by Zendesk