twilio / conversations-ios

SPM releases

Home Page:https://www.twilio.com/docs/conversations/ios/changelog

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'init' message failed: {"code":401,"status":"UNAUTHORIZED"}

cyiboy opened this issue · comments

commented

Stuck on this error all day, trying to init client with the token gotten for the server

token Sample

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTSzdlZWUwMDgzMWJlYjkzNmJhYjY1ZjRhMmUzMGFjNDI5LTE2ODYzMTI1MzciLCJncmFudHMiOnsiaWRlbnRpdHkiOiJzZWd1bmNvZGVzQGdtYWlsLmNvbSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJNRzJlYjI2NWNmMzRkYzUxNDY1MmY5YzY5YTdiOTk5ZTYzIn19LCJpYXQiOjE2ODYzMTI1MzcsImV4cCI6MTY4NjMxNjEzNywiaXNzIjoiU0s3ZWVlMDA4MzFiZWI5MzZiYWI2NWY0YTJlMzBhYzQyOSIsInN1YiI6IkFDNTE2OTAwYmFjZTU2N2Y4NmQ5MTI1ZDZlNTU5MzY2YjgifQ.CEB5lROTgeWExEVWlngQhTrmKmfKn9p8xWfqqzFxegA
<<<<TwilioConversationsClient: 0x282dfc540>>>> -   11 | Twilsock TransportDisconnecting | Reply 200 can not be sent. Twilsock is not in connected state
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    2 | Twilsock Client | closeRemotelyImpl in state TransportDisconnecting
<<<<TwilioConversationsClient: 0x282dfc540>>>> -   11 | Twilsock State.TransportDisconnecting | Disconnect process has already been started
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    2 | Twilsock Client | onTransportDisconnected in state TransportDisconnecting
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    2 | Twilsock Client | onTransportDisconnectedImpl in state TransportDisconnecting
ClientListener::onConnectionStateChange => state is DISCONNECTED
<<<<TwilioConversationsClient: 0x282dfc540>>>> -   11 | Twilsock State.TransportDisconnecting | Leaving state: TransportDisconnecting
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    5 | Twilsock State.Disconnected | Entering state: Disconnected
flutter: [  NATIVE  ] ClientListener::onConnectionStateChange => state is DISCONNECTED
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    2 | Twilsock Client | notifyAboutDisconnected: Unknown reason
<<<<TwilioConversationsClient: 0x282dfc540>>>> -   15 | Twilsock WebsocketIos | ~WebsocketIos destructed
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    2 | Twilsock Client | In state: Disconnected, post deferred event: UpstreamRequest
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    2 | Twilsock Client | In state: Disconnected, save event for future performing: UpstreamRequest (current size: 0)
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    5 | Twilsock Disconnected | RQ3da8b2a0020f444085ac2f840709538d Unable to send message in this state, sending rescheduled with timeout=90000
<<<<TwilioConversationsClient: 0x282dfc540>>>> -   25 | Sync NotificationRouter | Transport state changed. Is enabled: 0
<<<<TwilioConversationsClient: 0x282dfc540>>>> -      | SDK Convo-iOS | onConnectionStateUpdated moved to state 1
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    2 | Twilsock Client | onTransportDisconnected in state Disconnected
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    2 | Twilsock Client | onTransportDisconnectedImpl in state Disconnected
<<<<TwilioConversationsClient: 0x282dfc540>>>> -    5 | Twilsock State.Disconnected | Disconnected: Unexpected event: disconnected 'Websocket watchdog timeout'
<<<<TwilioConversationsClient: 0x282dfc540>>>> -      | Chat IPM | Client configuration timeout, init failed
ClientListener::onClientSynchronization => state is FAILED
<<<<TwilioConversationsClient: 0x282dfc540>>>> -      | Chat IPM | [UpeZD] client state: StateInitializing -> StateNotInitialized
<<<<TwilioConversationsClient: 0x282dfc540>>>> -      | Chat IPM | [listener] on client sync 3
flutter: [  NATIVE  ] ClientListener::onClientSynchronization => state is FAILED
<<<<TwilioConversationsClient: 0x282dfc540>>>> -      | SDK Convo-iOS | onClientSynchronization moved to state 3
<<<<TwilioConversationsClient: 0x282dfc540>>>> -      | Chat IPM | client [api] get channels
<<<<TwilioConversationsClient: 0x282dfc540>>>> -      | SDK Convo-iOS | createClient completion with result 500

Hello,

You have a wrong service sid in your token in chat grants. The proper one should start with IS.

Hello,

Did you manage to solve the issue?

I suppose the issue has been fixed, feel free to open a new one in case of need.