twilio / TwilioChatXamarinBindings

Twilio Chat Bindings for Xamarin (Android and iOS) and Sample app with working FCM and APN pushes using those bindings.
https://www.twilio.com/chat
MIT License
32 stars 15 forks source link

Request to EMS service has failed, unable to set FPA token #12

Closed jetri closed 5 years ago

jetri commented 6 years ago

Hi,

Can you please help!

I'm getting an the error using this token that I generated using a Twilio function. I've also already removed endpointid in the token as well. Not sure what else I'm doing wrong. Thanks!

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2Y2NzAzMzNiZDUyNTJiNmJlZDZkYzU2ZDg5MjgxZTFjLTE1MzExNTMwNTMiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJhIiwiaXBfbWVzc2FnaW5nIjp7InNlcnZpY2Vfc2lkIjoiSVNkOTM0ZTcyNzBjYmQ0MDU4YjExNTljYzgzODU5MWQ0YiIsInB1c2hfY3JlZGVudGlhbF9zaWQiOiJDUmZiMTRjNDhkZTFmNTFkODA5YmRhNzhlOGNkOWU3NWJkIn19LCJpYXQiOjE1MzExNTMwNTMsImV4cCI6MTUzMTE1NjY1MywiaXNzIjoiU0tmNjcwMzMzYmQ1MjUyYjZiZWQ2ZGM1NmQ4OTI4MWUxYyIsInN1YiI6IkFDZTEzOTk0MTZlOGJlNmI5NGM1Y2E5YTg5YTQyNmEwM2MifQ.9Mv5dO6GnxpnYHZ-6DE_uTN6gvqCTpcw0WpVQ4PnY3g

berkus commented 6 years ago

Hi, your token looks valid; let me investigate a bit, I'll get back to you.

berkus commented 6 years ago

Hi, could you please collect the logs for the token call that fails for you?

jetri commented 6 years ago

Thanks for helping look into this @berkus! Here's the log:

`[TWC:] -2086143632 | 07/10/00:17:47.734 | DEBUG | | Using root certificate store: /data/user/0/com.twilio.rtd.xamarin.ChatDemo/files/rootcert.pem [TWC: IoService] -2086143632 | 07/10/00:17:47.741 | INFO | IoService | Creating 16 threads in the executor pool [TWC: TNTwilsockClient] -2086143632 | 07/10/00:17:47.743 | DEBUG | 1 | TNTwilsockClient | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: x86 [TWC: TNTwilsockClient] -2086143632 | 07/10/00:17:47.747 | DEBUG | 1 | TNTwilsockClient | Default thread pool: Available: 16; Capacity: 16 [TWC: TNHttpTransportClient] -2086143632 | 07/10/00:17:47.747 | INFO | 4 | TNHttpTransportClient | initialising... [TWC: TNHttpTransportClient] -2086143632 | 07/10/00:17:47.747 | INFO | 4 | TNHttpTransportClient | initialised [TWC: TCEmsClient] -2086143632 | 07/10/00:17:47.747 | DEBUG | 6 | TCEmsClient | TCEmsClient [TWC: TCBackoffEmsClient] -2086143632 | 07/10/00:17:47.747 | DEBUG | 5 | TCBackoffEmsClient | init [TWC: TCEmsClient] -2086143632 | 07/10/00:17:47.747 | DEBUG | 6 | TCEmsClient | init [TWC: TCBackoffEmsClient] -2086143632 | 07/10/00:17:47.747 | DEBUG | 5 | TCBackoffEmsClient | setToken, {"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2Y2NzAzMzNiZDUyNTJiNmJlZDZkYzU2ZDg5MjgxZTFjLTE1MzExNTMwNTMiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJhIiwiaXBfbWVzc2FnaW5nIjp7InNlcnZpY2Vfc2lkIjoiSVNkOTM0ZTcyNzBjYmQ0MDU4YjExNTljYzgzODU5MWQ0YiIsInB1c2hfY3JlZGVudGlhbF9zaWQiOiJDUmZiMTRjNDhkZTFmNTFkODA5YmRhNzhlOGNkOWU3NWJkIn19LCJpYXQiOjE1MzExNTMwNTMsImV4cCI6MTUzMTE1NjY1MywiaXNzIjoiU0tmNjcwMzMzYmQ1MjUyYjZiZWQ2ZGM1NmQ4OTI4MWUxYyIsInN1YiI6IkFDZTEzOTk0MTZlOGJlNmI5NGM1Y2E5YTg5YTQyNmEwM2MifQ.9Mv5dO6GnxpnYHZ-6DE_uTN6gvqCTpcw0WpVQ4PnY3g"} [TWC: TCBackoffEmsClient] -2086143632 | 07/10/00:17:47.747 | DEBUG | 5 | TCBackoffEmsClient | scheduleSetToken [TWC: TCBackoffEmsClient] -2086143632 | 07/10/00:17:47.747 | INFO | 5 | TCBackoffEmsClient | schedule new task [TWC: TCBackoffEmsClient] -2111776400 | 07/10/00:17:47.748 | DEBUG | 5 | TCBackoffEmsClient | internal set token run... [TWC: TCEmsClient] -2111776400 | 07/10/00:17:47.748 | DEBUG | 6 | TCEmsClient | setToken [TWC: TCEmsClient] -2111776400 | 07/10/00:17:47.748 | DEBUG | 6 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -2111776400 | 07/10/00:17:47.748 | DEBUG | 7 | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: x86 [Mono] DllImport searching in: '__Internal' ('(null)'). [Mono] Searching for 'java_interop_jnienv_call_boolean_method'. [Mono] Probing 'java_interop_jnienv_call_boolean_method'. [Mono] Found as 'java_interop_jnienv_call_boolean_method'. [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:47.760 | INFO | 1 | TNTwilsockClient | connectImpl >> Disconnected [TWC: TNTwilsockClientImpl] -2087179920 | 07/10/00:17:47.760 | DEBUG | 3 | TNTwilsockClientImpl | connect [TWC: TNDisconnectedState] -2087179920 | 07/10/00:17:47.761 | INFO | 2 | TNDisconnectedState | Leaving state: Disconnected [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:47.761 | INFO | 1 | TNTwilsockClient | Change state: Disconnected --> Transport connecting [TWC: TNTransportConnectingState] -2087179920 | 07/10/00:17:47.761 | INFO | 9 | TNTransportConnectingState | Entering state: Transport connecting [TWC: TNTwilsockClientImpl] -2087179920 | 07/10/00:17:47.761 | DEBUG | 3 | TNTwilsockClientImpl | startTransportConnectingTimer [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:47.761 | INFO | 1 | TNTwilsockClient | addObserverImpl >> Transport connecting [TWC: TNTwilsockClientImpl] -2087179920 | 07/10/00:17:47.761 | DEBUG | 3 | TNTwilsockClientImpl | addObserver [TWC: TNHttpTransportClient] -2087179920 | 07/10/00:17:47.761 | INFO | 4 | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason [TWC: TNHttpTransportClient] -2111776400 | 07/10/00:17:47.764 | INFO | 4 | TNHttpTransportClient | requestId=RQeac30425b85343c883c5562e0c26bf65, enqueueing request to: https://ems.us1.twilio.com/v1/token [TWC: TCEmsClient] -2111776400 | 07/10/00:17:47.764 | DEBUG | 6 | TCEmsClient | setToken - end [TWC: TNWebsocket] -2116957840 | 07/10/00:17:47.764 | DEBUG | 8 | TNWebsocket | Connecting... [TWC: TNWebsocket] -2116957840 | 07/10/00:17:47.764 | DEBUG | 8 | TNWebsocket | Using proxy : except () [TWC: TNWebsocket] -2116957840 | 07/10/00:17:47.764 | DEBUG | 8 | TNWebsocket | Trying to establish connection to: https://tsock.us1.twilio.com

[TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:49.534 | INFO | 1 | TNTwilsockClient | onTransportConnectedImpl >> Transport connecting [TWC: TNTwilsockClientImpl] -2087179920 | 07/10/00:17:49.534 | DEBUG | 3 | TNTwilsockClientImpl | sendInit [TWC: TNTwilsockClientImpl] -2087179920 | 07/10/00:17:49.536 | INFO | 3 | TNTwilsockClientImpl | sendInit, id = bf50cca42ded40c1b2d75ac4515d701f701f [TWC: TNTransportConnectingState] -2087179920 | 07/10/00:17:49.536 | INFO | 9 | TNTransportConnectingState | Leaving state: Transport connecting [TWC: TNTwilsockClientImpl] -2087179920 | 07/10/00:17:49.536 | DEBUG | 3 | TNTwilsockClientImpl | stopTransportConnectingTimer [TWC: TNWebsocket] -2116957840 | 07/10/00:17:49.536 | DEBUG | 8 | TNWebsocket | Sending frame via websocket (659) [TWC: TNWebsocket] TWILSOCK V3.0 638 [TWC: TNWebsocket] {"id":"bf50cca42ded40c1b2d75ac4515d701f701f","method":"init","token":"{\"token\":\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2Y2NzAzMzNiZDUyNTJiNmJlZDZkYzU2ZDg5MjgxZTFjLTE1MzExNTMwNTMiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJhIiwiaXBfbWVzc2FnaW5nIjp7InNlcnZpY2Vfc2lkIjoiSVNkOTM0ZTcyNzBjYmQ0MDU4YjExNTljYzgzODU5MWQ0YiIsInB1c2hfY3JlZGVudGlhbF9zaWQiOiJDUmZiMTRjNDhkZTFmNTFkODA5YmRhNzhlOGNkOWU3NWJkIn19LCJpYXQiOjE1MzExNTMwNTMsImV4cCI6MTUzMTE1NjY1MywiaXNzIjoiU0tmNjcwMzMzYmQ1MjUyYjZiZWQ2ZGM1NmQ4OTI4MWUxYyIsInN1YiI6IkFDZTEzOTk0MTZlOGJlNmI5NGM1Y2E5YTg5YTQyNmEwM2MifQ.9Mv5dO6GnxpnYHZ-6DE_uTN6gvqCTpcw0WpVQ4PnY3g\"}"} [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:49.536 | INFO | 1 | TNTwilsockClient | Change state: Transport connecting --> Initialising [TWC: TNInitialisingState] -2087179920 | 07/10/00:17:49.536 | INFO | 10 | TNInitialisingState | Entering state: Initialising [zygote] Do partial code cache collection, code=54KB, data=52KB [zygote] After code cache collection, code=54KB, data=52KB [zygote] Increasing code cache capacity to 256KB [TWC: TNWebsocket] -2114885264 | 07/10/00:17:49.859 | DEBUG | 8 | TNWebsocket | Receive message 180 bytes [TWC: TNTwilsockClient] -2114885264 | 07/10/00:17:49.860 | DEBUG | 1 | TNTwilsockClient | onMessageReceived (210) [TWC: TNTwilsockClient] TWILSOCK V3.0 189 [TWC: TNTwilsockClient] {"method":"reply","id":"bf50cca42ded40c1b2d75ac4515d701f701f","payload_size":0,"status":{"description":"Invalid Access Token","errorCode":20101,"code":401,"status":"AUTHENTICATION_FAILED"}} [TWC: TNTwilsockClient] -2114885264 | 07/10/00:17:49.860 | INFO | 1 | TNTwilsockClient | onMessageReceived, method = 8, id = bf50cca42ded40c1b2d75ac4515d701f701f [TWC: TNTwilsockClientImpl] -2114885264 | 07/10/00:17:49.860 | DEBUG | 3 | TNTwilsockClientImpl | proceedReplyMessage bf50cca42ded40c1b2d75ac4515d701f701f [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:49.860 | DEBUG | 1 | TNTwilsockClient | Reply for 'bf50cca42ded40c1b2d75ac4515d701f701f' [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:49.860 | WARNING | 1 | TNTwilsockClient | Reply status for init request is not success: 401, AUTHENTICATION_FAILED [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:49.860 | INFO | 1 | TNTwilsockClient | ReceivedErrorInitReply >> Initialising [TWC: TNTwilsockClientImpl] -2087179920 | 07/10/00:17:49.860 | DEBUG | 3 | TNTwilsockClientImpl | notifyAboutError [TWC: TNTwilsockClientImpl] -2087179920 | 07/10/00:17:49.860 | DEBUG | 3 | TNTwilsockClientImpl | disconnect [TWC: TNWebsocket] -2087179920 | 07/10/00:17:49.860 | DEBUG | 8 | TNWebsocket | Disconnect [TWC: TNWebsocket] -2087179920 | 07/10/00:17:49.860 | DEBUG | 8 | TNWebsocket | Reset session [TWC: TNWebsocket] -2116957840 | 07/10/00:17:49.860 | DEBUG | 8 | TNWebsocket | Disconnecting... [TWC: TNWebsocket] -2114885264 | 07/10/00:17:50.149 | DEBUG | 8 | TNWebsocket | Receive message 179 bytes [TWC: TNTwilsockClient] -2114885264 | 07/10/00:17:50.149 | DEBUG | 1 | TNTwilsockClient | onMessageReceived (208) [TWC: TNTwilsockClient] TWILSOCK V3.0 187 [TWC: TNTwilsockClient] {"method":"close","id":"TM98e0eecf5e9344d4a037b0eaaa6acd59","payload_size":0,"status":{"description":"Invalid Access Token","errorCode":20101,"code":401,"status":"AUTHENTICATION_FAILED"}} [TWC: TNTwilsockClient] -2114885264 | 07/10/00:17:50.149 | INFO | 1 | TNTwilsockClient | onMessageReceived, method = 3, id = TM98e0eecf5e9344d4a037b0eaaa6acd59 [TWC: TNTwilsockClientImpl] -2114885264 | 07/10/00:17:50.149 | DEBUG | 3 | TNTwilsockClientImpl | proceedCloseMessage TM98e0eecf5e9344d4a037b0eaaa6acd59 [TWC: TNTwilsockClientImpl] -2114885264 | 07/10/00:17:50.149 | INFO | 3 | TNTwilsockClientImpl | Server has just initiated process of closing connection! 401: AUTHENTICATION_FAILED [TWC: TNWebsocket] -2116957840 | 07/10/00:17:50.149 | DEBUG | 8 | TNWebsocket | Disconnected [TWC: TNTwilsockClient] -2116957840 | 07/10/00:17:50.149 | DEBUG | 1 | TNTwilsockClient | onDisconnected [TWC: TNInitialisingState] -2087179920 | 07/10/00:17:50.149 | INFO | 10 | TNInitialisingState | Leaving state: Initialising [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:50.149 | INFO | 1 | TNTwilsockClient | Change state: Initialising --> TransportDisconnecting [TWC: TNTransportDisconnectingState] -2087179920 | 07/10/00:17:50.150 | INFO | 11 | TNTransportDisconnectingState | Entering state: TransportDisconnecting [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:50.150 | INFO | 1 | TNTwilsockClient | stopUpstreamRequests [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:50.150 | INFO | 1 | TNTwilsockClient | sendSuccessReplyImpl >> TransportDisconnecting [TWC: TNTransportDisconnectingState] -2087179920 | 07/10/00:17:50.150 | WARNING | 11 | TNTransportDisconnectingState | Success reply can not be sent. Twilsock is not in connected state [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:50.150 | INFO | 1 | TNTwilsockClient | closeRemotelyImpl >> TransportDisconnecting [TWC: TNTransportDisconnectingState] -2087179920 | 07/10/00:17:50.150 | WARNING | 11 | TNTransportDisconnectingState | Disconnect procedure has been already started [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:50.150 | INFO | 1 | TNTwilsockClient | onDisconnectedImpl >> TransportDisconnecting [TWC: TNTransportDisconnectingState] -2087179920 | 07/10/00:17:50.150 | INFO | 11 | TNTransportDisconnectingState | Leaving state: TransportDisconnecting [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:50.150 | INFO | 1 | TNTwilsockClient | Change state: TransportDisconnecting --> Disconnected [TWC: TNDisconnectedState] -2087179920 | 07/10/00:17:50.150 | INFO | 2 | TNDisconnectedState | Entering state: Disconnected [TWC: TNTwilsockClientImpl] -2087179920 | 07/10/00:17:50.150 | DEBUG | 3 | TNTwilsockClientImpl | notifyAboutDisconnected [TWC: TNHttpTransportClient] -2087179920 | 07/10/00:17:50.150 | INFO | 4 | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:50.150 | INFO | 1 | TNTwilsockClient | reset [TWC: TNWebsocket] -2087179920 | 07/10/00:17:50.150 | DEBUG | 8 | TNWebsocket | ~TNWebsocket - begin [TWC: TNWebsocket] -2087179920 | 07/10/00:17:50.150 | DEBUG | 8 | TNWebsocket | Reset session [TWC: TNWebsocket] -2116957840 | 07/10/00:17:50.150 | DEBUG | 8 | TNWebsocket | close [TWC: TNWebsocket] -2087179920 | 07/10/00:17:50.150 | DEBUG | 8 | TNWebsocket | ~TNWebsocket - end [TWC: TNTwilsockClient] -2087179920 | 07/10/00:17:50.150 | INFO | 1 | TNTwilsockClient | stopUpstreamRequests [TWC: TNHttpTransportClient] -2110740112 | 07/10/00:17:52.766 | DEBUG | 4 | TNHttpTransportClient | dequeueing request: RQeac30425b85343c883c5562e0c26bf65 [TWC: TCHttpObserver] -2110740112 | 07/10/00:17:52.767 | DEBUG | 7 | TCHttpObserver | onFailed - begin [TWC: TCHttpObserver] -2110740112 | 07/10/00:17:52.767 | WARNING | 7 | TCHttpObserver | Request has failed: Transport connection closed (3) [TWC: TCHttpObserver] -2110740112 | 07/10/00:17:52.767 | DEBUG | 7 | TCHttpObserver | setPromise - 3 [TWC: TCBackoffEmsClient] -2110740112 | 07/10/00:17:52.767 | DEBUG | 5 | TCBackoffEmsClient | internal set token result: 3 [TWC: TCEmsClient] -2110740112 | 07/10/00:17:52.767 | DEBUG | 6 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -2110740112 | 07/10/00:17:52.767 | DEBUG | 7 | TCHttpObserver | onFailed - end [TWC: TCHttpObserver] -2110740112 | 07/10/00:17:52.767 | DEBUG | 7 | TCHttpObserver | ~TCHttpObserver - begin [TWC: TCHttpObserver] -2110740112 | 07/10/00:17:52.767 | DEBUG | 7 | TCHttpObserver | ~TCHttpObserver - end [TWC: TCBackoffEmsClient] -2110740112 | 07/10/00:17:52.767 | DEBUG | 5 | TCBackoffEmsClient | internal set token run... [TWC: TCEmsClient] -2110740112 | 07/10/00:17:52.767 | DEBUG | 6 | TCEmsClient | setToken [TWC: TCEmsClient] -2110740112 | 07/10/00:17:52.767 | DEBUG | 6 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -2110740112 | 07/10/00:17:52.767 | DEBUG | 12 | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: x86 [TWC: TNHttpTransportClient] -2110740112 | 07/10/00:17:52.769 | INFO | 4 | TNHttpTransportClient | requestId=RQe0927f7baa784b609c3fe84a7d0d4fb9, enqueueing request to: https://ems.us1.twilio.com/v1/token [TWC: TCEmsClient] -2110740112 | 07/10/00:17:52.769 | DEBUG | 6 | TCEmsClient | setToken - end [TWC: TNHttpTransportClient] -2101413520 | 07/10/00:17:57.773 | DEBUG | 4 | TNHttpTransportClient | dequeueing request: RQe0927f7baa784b609c3fe84a7d0d4fb9 [TWC: TCHttpObserver] -2101413520 | 07/10/00:17:57.774 | DEBUG | 12 | TCHttpObserver | onFailed - begin [TWC: TCHttpObserver] -2101413520 | 07/10/00:17:57.774 | WARNING | 12 | TCHttpObserver | Request has failed: Transport connection closed (3) [TWC: TCHttpObserver] -2101413520 | 07/10/00:17:57.774 | DEBUG | 12 | TCHttpObserver | setPromise - 3 [TWC: TCBackoffEmsClient] -2101413520 | 07/10/00:17:57.774 | DEBUG | 5 | TCBackoffEmsClient | internal set token result: 3 [TWC: TCEmsClient] -2101413520 | 07/10/00:17:57.774 | DEBUG | 6 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -2101413520 | 07/10/00:17:57.774 | DEBUG | 12 | TCHttpObserver | onFailed - end [TWC: TCHttpObserver] -2101413520 | 07/10/00:17:57.774 | DEBUG | 12 | TCHttpObserver | ~TCHttpObserver - begin [TWC: TCHttpObserver] -2101413520 | 07/10/00:17:57.774 | DEBUG | 12 | TCHttpObserver | ~TCHttpObserver - end [TWC: TCBackoffEmsClient] -2107631248 | 07/10/00:17:57.774 | DEBUG | 5 | TCBackoffEmsClient | internal set token run... [TWC: TCEmsClient] -2107631248 | 07/10/00:17:57.774 | DEBUG | 6 | TCEmsClient | setToken [TWC: TCEmsClient] -2107631248 | 07/10/00:17:57.774 | DEBUG | 6 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -2107631248 | 07/10/00:17:57.774 | DEBUG | 13 | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: x86 [TWC: TNHttpTransportClient] -2107631248 | 07/10/00:17:57.777 | INFO | 4 | TNHttpTransportClient | requestId=RQ11c06b2faa7b476da2caa1abeb5e99c6, enqueueing request to: https://ems.us1.twilio.com/v1/token [TWC: TCEmsClient] -2107631248 | 07/10/00:17:57.778 | DEBUG | 6 | TCEmsClient | setToken - end Thread finished: #5 [TWC: TNHttpTransportClient] -2101413520 | 07/10/00:18:02.784 | DEBUG | 4 | TNHttpTransportClient | dequeueing request: RQ11c06b2faa7b476da2caa1abeb5e99c6 [TWC: TCHttpObserver] -2101413520 | 07/10/00:18:02.784 | DEBUG | 13 | TCHttpObserver | onFailed - begin [TWC: TCHttpObserver] -2101413520 | 07/10/00:18:02.784 | WARNING | 13 | TCHttpObserver | Request has failed: Transport connection closed (3) [TWC: TCHttpObserver] -2101413520 | 07/10/00:18:02.784 | DEBUG | 13 | TCHttpObserver | setPromise - 3 [TWC: TCBackoffEmsClient] -2101413520 | 07/10/00:18:02.784 | DEBUG | 5 | TCBackoffEmsClient | internal set token result: 3 [TWC: TCBackoffEmsClient] -2101413520 | 07/10/00:18:02.784 | INFO | 5 | TCBackoffEmsClient | backoff result: 2 - 'Time is exceeded', setToken result: 3 [TWC: TCBackoffEmsClient] -2101413520 | 07/10/00:18:02.784 | DEBUG | 5 | TCBackoffEmsClient | scheduleSetToken [TWC: TCEmsClient] -2101413520 | 07/10/00:18:02.784 | DEBUG | 6 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -2101413520 | 07/10/00:18:02.784 | DEBUG | 13 | TCHttpObserver | onFailed - end [TWC: TCHttpObserver] -2101413520 | 07/10/00:18:02.784 | DEBUG | 13 | TCHttpObserver | ~TCHttpObserver - begin [TWC: TCHttpObserver] -2101413520 | 07/10/00:18:02.784 | DEBUG | 13 | TCHttpObserver | ~TCHttpObserver - end [jni_mate] Got method ID 0xa738bd74 for method (ILjava/lang/String;)V [TWC: TNTwilsockClient] -2086143632 | 07/10/00:18:02.784 | DEBUG | 1 | TNTwilsockClient | ~TNTwilsockClient - begin [TWC: TNTwilsockClient] -2086143632 | 07/10/00:18:02.784 | DEBUG | 1 | TNTwilsockClient | Cleaning observers list - begin [TWC: TNTwilsockClient] -2086143632 | 07/10/00:18:02.784 | DEBUG | 1 | TNTwilsockClient | Cleaning observers list - end [TWC: TNTwilsockClient] -2086143632 | 07/10/00:18:02.785 | DEBUG | 1 | TNTwilsockClient | cleanup_threads - begin [TWC: TNTwilsockClient] -2086143632 | 07/10/00:18:02.785 | DEBUG | 1 | TNTwilsockClient | Default thread pool: Available: 16; Capacity: 16 [TWC: TNTwilsockClient] -2086143632 | 07/10/00:18:02.785 | DEBUG | 1 | TNTwilsockClient | cleanup_threads - end [TWC: TNTwilsockClient] -2086143632 | 07/10/00:18:02.785 | DEBUG | 1 | TNTwilsockClient | ~TNTwilsockClient - end [TWC: TNTwilsockClientImpl] -2086143632 | 07/10/00:18:02.785 | DEBUG | 3 | TNTwilsockClientImpl | destructed`

berkus commented 6 years ago

Hi!

Thanks for the log, it's clear now what happens.

"code":401,"status":"AUTHENTICATION_FAILED"

the token you have received from the auth service is in the JSON format {"token": <actual twilio token here>} but you pass it to twilio as a string; so it becomes something unparseable in incorrect format.

Just extract the actual token by using token["token"] when initializing ChatClient.

ghost commented 6 years ago

Hello @berkus , i am having the same issue as @jetri.

Here is the token returned from the twilio runtime function:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0LTE1MzEzMjA1MDciLCJncmFudHMiOnsiaWRlbnRpdHkiOiJ2ZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0IiwicHVzaF9jcmVkZW50aWFsX3NpZCI6IkJBYjFSTGg2Y1NmeEpYOGVQZ05BRGR3al9kRXFqME5pZHlWcklvbXA3TncyaFB3dmhoYk1NX0JVLUtqNHFZaGhja1FmWDJ5TlBib2J3ZV9uWG5TQkZzWSJ9fSwiaWF0IjoxNTMxMzIwNTA3LCJleHAiOjE1MzEzMjQxMDcsImlzcyI6IlNLMDRlMzdhYThkMmIwZDBiODg3OGFlNjgxMTE4MmUyYzQiLCJzdWIiOiJBQzBiZWIwODVkNThiY2ZlYTUwMDk1MzYwMThkYTM3OTIzIn0.MhgL1TYd826cHfjhFyp3H24b1q2vnc45TSXZpOdO4fY

here are the logs:

[TWC:]        -1651607248 | 07/11/11:12:44.778 | DEBUG    |  | Using root certificate store: /data/user/0/com.twilio.rtd.xamarin.ChatDemo/files/rootcert.pem
[TWC: IoService]        -1651607248 | 07/11/11:12:44.798 | INFO     | IoService | Creating 16 threads in the executor pool
[TWC: TNTwilsockClient]        -1651607248 | 07/11/11:12:44.801 | DEBUG    | 1      | TNTwilsockClient | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a
[TWC: TNTwilsockClient]        -1651607248 | 07/11/11:12:44.802 | DEBUG    | 1      | TNTwilsockClient | Default thread pool: Available: 16; Capacity: 16
[TWC: TNHttpTransportClient]        -1651607248 | 07/11/11:12:44.803 | INFO     | 4      | TNHttpTransportClient | initialising...
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:44.803 | INFO     | 1      | TNTwilsockClient | connectImpl >> Disconnected
[TWC: TNHttpTransportClient]        -1651607248 | 07/11/11:12:44.803 | INFO     | 4      | TNHttpTransportClient | initialised
[TWC: TCEmsClient]        -1651607248 | 07/11/11:12:44.803 | DEBUG    | 6      | TCEmsClient | TCEmsClient
[TWC: TCBackoffEmsClient]        -1651607248 | 07/11/11:12:44.803 | DEBUG    | 5      | TCBackoffEmsClient | init
[TWC: TCEmsClient]        -1651607248 | 07/11/11:12:44.803 | DEBUG    | 6      | TCEmsClient | init
[TWC: TCBackoffEmsClient]        -1651607248 | 07/11/11:12:44.803 | DEBUG    | 5      | TCBackoffEmsClient | setToken, eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0LTE1MzEzMjE5NjQiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJ2ZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0IiwicHVzaF9jcmVkZW50aWFsX3NpZCI6IkJBYjFSTGg2Y1NmeEpYOGVQZ05BRGR3al9kRXFqME5pZHlWcklvbXA3TncyaFB3dmhoYk1NX0JVLUtqNHFZaGhja1FmWDJ5TlBib2J3ZV9uWG5TQkZzWSJ9fSwiaWF0IjoxNTMxMzIxOTY0LCJleHAiOjE1MzEzMjU1NjQsImlzcyI6IlNLMDRlMzdhYThkMmIwZDBiODg3OGFlNjgxMTE4MmUyYzQiLCJzdWIiOiJBQzBiZWIwODVkNThiY2ZlYTUwMDk1MzYwMThkYTM3OTIzIn0.kmUq_nA6kYp_C2ZnqwrlMXIX3KJr9R27bR5PffIiEdA
[TWC: TCBackoffEmsClient]        -1651607248 | 07/11/11:12:44.804 | DEBUG    | 5      | TCBackoffEmsClient | scheduleSetToken
[TWC: TCBackoffEmsClient]        -1651607248 | 07/11/11:12:44.804 | INFO     | 5      | TCBackoffEmsClient | schedule new task
[TWC: TCBackoffEmsClient]        -1653696208 | 07/11/11:12:44.804 | DEBUG    | 5      | TCBackoffEmsClient | internal set token run...
[TWC: TCEmsClient]        -1653696208 | 07/11/11:12:44.804 | DEBUG    | 6      | TCEmsClient | setToken
[TWC: TCEmsClient]        -1653696208 | 07/11/11:12:44.804 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TNTwilsockClientImpl]        -1652651728 | 07/11/11:12:44.804 | DEBUG    | 3      | TNTwilsockClientImpl | connect
[TWC: TNDisconnectedState]        -1652651728 | 07/11/11:12:44.805 | INFO     | 2      | TNDisconnectedState | Leaving state: Disconnected
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:44.805 | INFO     | 1      | TNTwilsockClient | Change state: Disconnected --> Transport connecting
[TWC: TNTransportConnectingState]        -1652651728 | 07/11/11:12:44.806 | INFO     | 8      | TNTransportConnectingState | Entering state: Transport connecting
[TWC: TNTwilsockClientImpl]        -1652651728 | 07/11/11:12:44.806 | DEBUG    | 3      | TNTwilsockClientImpl | startTransportConnectingTimer
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:44.806 | INFO     | 1      | TNTwilsockClient | addObserverImpl >> Transport connecting
[TWC: TNTwilsockClientImpl]        -1652651728 | 07/11/11:12:44.806 | DEBUG    | 3      | TNTwilsockClientImpl | addObserver
[TWC: TNHttpTransportClient]        -1652651728 | 07/11/11:12:44.807 | INFO     | 4      | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason
[TWC: TCHttpObserver]        -1653696208 | 07/11/11:12:44.807 | DEBUG    | 9      | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a
[TWC: TNWebsocket]        -1672705744 | 07/11/11:12:44.810 | DEBUG    | 7      | TNWebsocket | Connecting...
[TWC: TNWebsocket]        -1672705744 | 07/11/11:12:44.810 | DEBUG    | 7      | TNWebsocket | Using proxy : except ()
[TWC: TNWebsocket]        -1672705744 | 07/11/11:12:44.810 | DEBUG    | 7      | TNWebsocket | Trying to establish connection to: https://tsock.us1.twilio.com
[TWC: TNHttpTransportClient]        -1653696208 | 07/11/11:12:44.814 | INFO     | 4      | TNHttpTransportClient | requestId=RQb3611e7f9344491b9655e89edfd09755, enqueueing request to: https://ems.us1.twilio.com/v1/token
[TWC: TCEmsClient]        -1653696208 | 07/11/11:12:44.814 | DEBUG    | 6      | TCEmsClient | setToken - end
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_call_boolean_method'.
[Mono] Probing 'java_interop_jnienv_call_boolean_method'.
[Mono] Found as 'java_interop_jnienv_call_boolean_method'.
[Mono] Assembly Ref addref Xamarin.Android.Support.Core.UI[0x8018d130] -> Xamarin.Android.Support.Compat[0x8014cae0]: 5
[AbsListView] Get MotionRecognitionManager
[MotionRecognitionManager] mSContextService = null
[MotionRecognitionManager] motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@2be2b1a
[AbsListView] viewType is heaer or footer
[AbsListView] viewType is heaer or footer
[AbsListView]  onsize change 
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.044 | INFO     | 1      | TNTwilsockClient | onTransportConnectedImpl >> Transport connecting
[TWC: TNTwilsockClientImpl]        -1652651728 | 07/11/11:12:45.044 | DEBUG    | 3      | TNTwilsockClientImpl | sendInit
[TWC: TNTwilsockClientImpl]        -1652651728 | 07/11/11:12:45.050 | INFO     | 3      | TNTwilsockClientImpl | sendInit, id = e9e5449162f54f43b05a7c27024379157915
[TWC: TNTransportConnectingState]        -1652651728 | 07/11/11:12:45.056 | INFO     | 8      | TNTransportConnectingState | Leaving state: Transport connecting
[TWC: TNTwilsockClientImpl]        -1652651728 | 07/11/11:12:45.057 | DEBUG    | 3      | TNTwilsockClientImpl | stopTransportConnectingTimer
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.057 | INFO     | 1      | TNTwilsockClient | Change state: Transport connecting --> Initialising
[TWC: TNInitialisingState]        -1652651728 | 07/11/11:12:45.057 | INFO     | 10     | TNInitialisingState | Entering state: Initialising
[TWC: TNWebsocket]        -1672705744 | 07/11/11:12:45.060 | DEBUG    | 7      | TNWebsocket | Sending frame via websocket (708)
[TWC: TNWebsocket] TWILSOCK V3.0 687
[TWC: TNWebsocket] {"id":"e9e5449162f54f43b05a7c27024379157915","method":"init","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0LTE1MzEzMjE5NjQiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJ2ZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0IiwicHVzaF9jcmVkZW50aWFsX3NpZCI6IkJBYjFSTGg2Y1NmeEpYOGVQZ05BRGR3al9kRXFqME5pZHlWcklvbXA3TncyaFB3dmhoYk1NX0JVLUtqNHFZaGhja1FmWDJ5TlBib2J3ZV9uWG5TQkZzWSJ9fSwiaWF0IjoxNTMxMzIxOTY0LCJleHAiOjE1MzEzMjU1NjQsImlzcyI6IlNLMDRlMzdhYThkMmIwZDBiODg3OGFlNjgxMTE4MmUyYzQiLCJzdWIiOiJBQzBiZWIwODVkNThiY2ZlYTUwMDk1MzYwMThkYTM3OTIzIn0.kmUq_nA6kYp_C2ZnqwrlMXIX3KJr9R27bR5PffIiEdA"}
[libGLESv2] HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
[libGLESv2] HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
[TWC: TNWebsocket]        -1670592208 | 07/11/11:12:45.105 | DEBUG    | 7      | TNWebsocket | Receive message 193 bytes
[TWC: TNTwilsockClient]        -1670592208 | 07/11/11:12:45.105 | DEBUG    | 1      | TNTwilsockClient | onMessageReceived (225)
[TWC: TNTwilsockClient] TWILSOCK V3.0 204
[TWC: TNTwilsockClient] {"method":"reply","id":"e9e5449162f54f43b05a7c27024379157915","payload_size":0,"status":{"description":"The authorization with Token failed","errorCode":20151,"code":401,"status":"AUTHENTICATION_FAILED"}}
[TWC: TNTwilsockClient]        -1670592208 | 07/11/11:12:45.105 | INFO     | 1      | TNTwilsockClient | onMessageReceived, method = 8, id = e9e5449162f54f43b05a7c27024379157915
[TWC: TNTwilsockClientImpl]        -1670592208 | 07/11/11:12:45.105 | DEBUG    | 3      | TNTwilsockClientImpl | proceedReplyMessage e9e5449162f54f43b05a7c27024379157915
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.105 | DEBUG    | 1      | TNTwilsockClient | Reply for 'e9e5449162f54f43b05a7c27024379157915'
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.106 | WARNING  | 1      | TNTwilsockClient | Reply status for init request is not success: 401, AUTHENTICATION_FAILED
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.106 | INFO     | 1      | TNTwilsockClient | ReceivedErrorInitReply >> Initialising
[TWC: TNTwilsockClientImpl]        -1652651728 | 07/11/11:12:45.106 | DEBUG    | 3      | TNTwilsockClientImpl | notifyAboutError
[TWC: TNTwilsockClientImpl]        -1652651728 | 07/11/11:12:45.106 | DEBUG    | 3      | TNTwilsockClientImpl | disconnect
[TWC: TNWebsocket]        -1652651728 | 07/11/11:12:45.106 | DEBUG    | 7      | TNWebsocket | Disconnect
[TWC: TNWebsocket]        -1652651728 | 07/11/11:12:45.106 | DEBUG    | 7      | TNWebsocket | Reset session
[TWC: TNWebsocket]        -1672705744 | 07/11/11:12:45.106 | DEBUG    | 7      | TNWebsocket | Disconnecting...
[TWC: TNWebsocket]        -1670592208 | 07/11/11:12:45.136 | DEBUG    | 7      | TNWebsocket | Receive message 192 bytes
[TWC: TNTwilsockClient]        -1670592208 | 07/11/11:12:45.136 | DEBUG    | 1      | TNTwilsockClient | onMessageReceived (223)
[TWC: TNTwilsockClient] TWILSOCK V3.0 202
[TWC: TNTwilsockClient] {"method":"close","id":"TM7090eccbc26441f0938b418aae998f69","payload_size":0,"status":{"description":"The authorization with Token failed","errorCode":20151,"code":401,"status":"AUTHENTICATION_FAILED"}}
[TWC: TNTwilsockClient]        -1670592208 | 07/11/11:12:45.136 | INFO     | 1      | TNTwilsockClient | onMessageReceived, method = 3, id = TM7090eccbc26441f0938b418aae998f69
[TWC: TNTwilsockClientImpl]        -1670592208 | 07/11/11:12:45.136 | DEBUG    | 3      | TNTwilsockClientImpl | proceedCloseMessage TM7090eccbc26441f0938b418aae998f69
[TWC: TNTwilsockClientImpl]        -1670592208 | 07/11/11:12:45.136 | INFO     | 3      | TNTwilsockClientImpl | Server has just initiated process of closing connection! 401: AUTHENTICATION_FAILED
[TWC: TNWebsocket]        -1672705744 | 07/11/11:12:45.137 | DEBUG    | 7      | TNWebsocket | Disconnected
[TWC: TNTwilsockClient]        -1672705744 | 07/11/11:12:45.137 | DEBUG    | 1      | TNTwilsockClient | onDisconnected
[TWC: TNInitialisingState]        -1652651728 | 07/11/11:12:45.138 | INFO     | 10     | TNInitialisingState | Leaving state: Initialising
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.138 | INFO     | 1      | TNTwilsockClient | Change state: Initialising --> TransportDisconnecting
[TWC: TNTransportDisconnectingState]        -1652651728 | 07/11/11:12:45.138 | INFO     | 11     | TNTransportDisconnectingState | Entering state: TransportDisconnecting
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.138 | INFO     | 1      | TNTwilsockClient | stopUpstreamRequests
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.138 | INFO     | 1      | TNTwilsockClient | sendSuccessReplyImpl >> TransportDisconnecting
[TWC: TNTransportDisconnectingState]        -1652651728 | 07/11/11:12:45.138 | WARNING  | 11     | TNTransportDisconnectingState | Success reply can not be sent. Twilsock is not in connected state
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.138 | INFO     | 1      | TNTwilsockClient | closeRemotelyImpl >> TransportDisconnecting
[TWC: TNTransportDisconnectingState]        -1652651728 | 07/11/11:12:45.138 | WARNING  | 11     | TNTransportDisconnectingState | Disconnect procedure has been already started
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.138 | INFO     | 1      | TNTwilsockClient | onDisconnectedImpl >> TransportDisconnecting
[TWC: TNTransportDisconnectingState]        -1652651728 | 07/11/11:12:45.138 | INFO     | 11     | TNTransportDisconnectingState | Leaving state: TransportDisconnecting
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.138 | INFO     | 1      | TNTwilsockClient | Change state: TransportDisconnecting --> Disconnected
[TWC: TNDisconnectedState]        -1652651728 | 07/11/11:12:45.138 | INFO     | 2      | TNDisconnectedState | Entering state: Disconnected
[TWC: TNTwilsockClientImpl]        -1652651728 | 07/11/11:12:45.138 | DEBUG    | 3      | TNTwilsockClientImpl | notifyAboutDisconnected
[TWC: TNHttpTransportClient]        -1652651728 | 07/11/11:12:45.139 | INFO     | 4      | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.139 | INFO     | 1      | TNTwilsockClient | reset
[TWC: TNWebsocket]        -1652651728 | 07/11/11:12:45.139 | DEBUG    | 7      | TNWebsocket | ~TNWebsocket - begin
[TWC: TNWebsocket]        -1652651728 | 07/11/11:12:45.140 | DEBUG    | 7      | TNWebsocket | Reset session
[TWC: TNWebsocket]        -1672705744 | 07/11/11:12:45.140 | DEBUG    | 7      | TNWebsocket | close
[TWC: TNWebsocket]        -1652651728 | 07/11/11:12:45.140 | DEBUG    | 7      | TNWebsocket | ~TNWebsocket - end
[TWC: TNTwilsockClient]        -1652651728 | 07/11/11:12:45.140 | INFO     | 1      | TNTwilsockClient | stopUpstreamRequests
[TWC: TNHttpTransportClient]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 4      | TNHttpTransportClient | dequeueing request: RQb3611e7f9344491b9655e89edfd09755
[TWC: TCHttpObserver]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 9      | TCHttpObserver | onFailed - begin
[TWC: TCHttpObserver]        -1655785168 | 07/11/11:12:49.815 | WARNING  | 9      | TCHttpObserver | Request has failed: Transport connection closed (3)
[TWC: TCHttpObserver]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 9      | TCHttpObserver | setPromise - 3
[TWC: TCBackoffEmsClient]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 5      | TCBackoffEmsClient | internal set token result: 3
[TWC: TCEmsClient]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TCHttpObserver]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 9      | TCHttpObserver | onFailed - end
[TWC: TCHttpObserver]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 9      | TCHttpObserver | ~TCHttpObserver - begin
[TWC: TCHttpObserver]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 9      | TCHttpObserver | ~TCHttpObserver - end
[TWC: TCBackoffEmsClient]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 5      | TCBackoffEmsClient | internal set token run...
[TWC: TCEmsClient]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 6      | TCEmsClient | setToken
[TWC: TCEmsClient]        -1655785168 | 07/11/11:12:49.815 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TCHttpObserver]        -1655785168 | 07/11/11:12:49.816 | DEBUG    | 12     | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a
[TWC: TNHttpTransportClient]        -1655785168 | 07/11/11:12:49.823 | INFO     | 4      | TNHttpTransportClient | requestId=RQ6393c4247952463f904d1f855dddb51b, enqueueing request to: https://ems.us1.twilio.com/v1/token
[TWC: TCEmsClient]        -1655785168 | 07/11/11:12:49.823 | DEBUG    | 6      | TCEmsClient | setToken - end
[TWC: TNHttpTransportClient]        -1658955472 | 07/11/11:12:54.828 | DEBUG    | 4      | TNHttpTransportClient | dequeueing request: RQ6393c4247952463f904d1f855dddb51b
[TWC: TCHttpObserver]        -1658955472 | 07/11/11:12:54.828 | DEBUG    | 12     | TCHttpObserver | onFailed - begin
[TWC: TCHttpObserver]        -1658955472 | 07/11/11:12:54.828 | WARNING  | 12     | TCHttpObserver | Request has failed: Transport connection closed (3)
[TWC: TCHttpObserver]        -1658955472 | 07/11/11:12:54.828 | DEBUG    | 12     | TCHttpObserver | setPromise - 3
[TWC: TCBackoffEmsClient]        -1658955472 | 07/11/11:12:54.828 | DEBUG    | 5      | TCBackoffEmsClient | internal set token result: 3
[TWC: TCEmsClient]        -1658955472 | 07/11/11:12:54.828 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TCHttpObserver]        -1658955472 | 07/11/11:12:54.828 | DEBUG    | 12     | TCHttpObserver | onFailed - end
[TWC: TCHttpObserver]        -1658955472 | 07/11/11:12:54.828 | DEBUG    | 12     | TCHttpObserver | ~TCHttpObserver - begin
[TWC: TCHttpObserver]        -1658955472 | 07/11/11:12:54.828 | DEBUG    | 12     | TCHttpObserver | ~TCHttpObserver - end
[TWC: TCBackoffEmsClient]        -1658955472 | 07/11/11:12:54.829 | DEBUG    | 5      | TCBackoffEmsClient | internal set token run...
[TWC: TCEmsClient]        -1658955472 | 07/11/11:12:54.829 | DEBUG    | 6      | TCEmsClient | setToken
[TWC: TCEmsClient]        -1658955472 | 07/11/11:12:54.829 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TCHttpObserver]        -1658955472 | 07/11/11:12:54.830 | DEBUG    | 13     | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a
[TWC: TNHttpTransportClient]        -1658955472 | 07/11/11:12:54.836 | INFO     | 4      | TNHttpTransportClient | requestId=RQb133636aa50642498b7587ddbece1f24, enqueueing request to: https://ems.us1.twilio.com/v1/token
[TWC: TCEmsClient]        -1658955472 | 07/11/11:12:54.837 | DEBUG    | 6      | TCEmsClient | setToken - end
[TWC: TNHttpTransportClient]        -1664227024 | 07/11/11:12:59.840 | DEBUG    | 4      | TNHttpTransportClient | dequeueing request: RQb133636aa50642498b7587ddbece1f24
[TWC: TCHttpObserver]        -1664227024 | 07/11/11:12:59.840 | DEBUG    | 13     | TCHttpObserver | onFailed - begin
[TWC: TCHttpObserver]        -1664227024 | 07/11/11:12:59.840 | WARNING  | 13     | TCHttpObserver | Request has failed: Transport connection closed (3)
[TWC: TCHttpObserver]        -1664227024 | 07/11/11:12:59.840 | DEBUG    | 13     | TCHttpObserver | setPromise - 3
[TWC: TCBackoffEmsClient]        -1664227024 | 07/11/11:12:59.840 | DEBUG    | 5      | TCBackoffEmsClient | internal set token result: 3
[TWC: TCBackoffEmsClient]        -1664227024 | 07/11/11:12:59.840 | INFO     | 5      | TCBackoffEmsClient | backoff result: 2 - 'Time is exceeded', setToken result: 3
[TWC: TCBackoffEmsClient]        -1664227024 | 07/11/11:12:59.840 | DEBUG    | 5      | TCBackoffEmsClient | scheduleSetToken
[TWC: TCEmsClient]        -1664227024 | 07/11/11:12:59.841 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TCHttpObserver]        -1664227024 | 07/11/11:12:59.841 | DEBUG    | 13     | TCHttpObserver | onFailed - end
[TWC: TCHttpObserver]        -1664227024 | 07/11/11:12:59.841 | DEBUG    | 13     | TCHttpObserver | ~TCHttpObserver - begin
[TWC: TCHttpObserver]        -1664227024 | 07/11/11:12:59.841 | DEBUG    | 13     | TCHttpObserver | ~TCHttpObserver - end
[jni_mate] Got method ID 0xa04e6e80 for method <init>(ILjava/lang/String;)V
[TWC: TNTwilsockClient]        -1651607248 | 07/11/11:12:59.845 | DEBUG    | 1      | TNTwilsockClient | ~TNTwilsockClient - begin
[TWC: TNTwilsockClient]        -1651607248 | 07/11/11:12:59.845 | DEBUG    | 1      | TNTwilsockClient | Cleaning observers list - begin
[TWC: TNTwilsockClient]        -1651607248 | 07/11/11:12:59.845 | DEBUG    | 1      | TNTwilsockClient | Cleaning observers list - end
[TWC: TNTwilsockClient]        -1651607248 | 07/11/11:12:59.845 | DEBUG    | 1      | TNTwilsockClient | cleanup_threads - begin
[TWC: TNTwilsockClient]        -1651607248 | 07/11/11:12:59.845 | DEBUG    | 1      | TNTwilsockClient | Default thread pool: Available: 16; Capacity: 16
[TWC: TNTwilsockClient]        -1651607248 | 07/11/11:12:59.845 | DEBUG    | 1      | TNTwilsockClient | cleanup_threads - end
[TWC: TNTwilsockClient]        -1651607248 | 07/11/11:12:59.845 | DEBUG    | 1      | TNTwilsockClient | ~TNTwilsockClient - end
[TWC: TNTwilsockClientImpl]        -1651607248 | 07/11/11:12:59.845 | DEBUG    | 3      | TNTwilsockClientImpl | destructed
[art] Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[28,tid=22014,Native,Thread*=0x80db6a40,peer=0x12f460a0,"amarin.ChatDemo - 22014"]
[2018-07-11 11:12:59.856] [ERROR] [ChatClientCallbackListener] Error 0:3 Request to EMS service has failed, unable to set FPA token
[AbsListView] viewType is heaer or footer
[art] JNI RegisterNativeMethods: attempt to register 0 native methods for md51558244f76c53b6aeda52c8a337f2c37.CellRenderer_RendererHolder
[AbsListView] viewType is heaer or footer
[libGLESv2] HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
Thread finished: <Thread Pool> #7
berkus commented 6 years ago

@Daron-Rice you have invalid field in your token: "push_credential_sid": "BAb1RLh6cSfxJX8ePgNADdwj_dEqj0NidyVrIomp7Nw2hPwvhhbMM_BU-Kj4qYhhckQfX2yNPbobwe_nXnSBFsY" have you tried connecting with correct Push SID or without SID at all?

Push Credential SIDs are listed in your Twilio Console under Notify > Push Credentials in column SID.

ghost commented 6 years ago

@berkus - thanks for the help. i have fixed that now by putting the proper push_credential_sid value in the that field but i am still getting the same issue...

here is the new token:

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0LTE1MzEzNDQ1NTMiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJ2ZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0IiwicHVzaF9jcmVkZW50aWFsX3NpZCI6IkNSNTg4OTVkMTg0ZjVkZTY0ZWNlNmY3MGU3NGY3MmM0MTMifX0sImlhdCI6MTUzMTM0NDU1MywiZXhwIjoxNTMxMzQ4MTUzLCJpc3MiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0Iiwic3ViIjoiQUMwYmViMDg1ZDU4YmNmZWE1MDA5NTM2MDE4ZGEzNzkyMyJ9.5fIJowdOWDibCMpgkzARRPGQCEQHHt1XYjpnfEk2Ydk

Here are the logs:

[TWC:]        -1652717264 | 07/11/17:29:13.310 | DEBUG    |  | Using root certificate store: /data/user/0/com.twilio.rtd.xamarin.ChatDemo/files/rootcert.pem
[TWC: IoService]        -1652717264 | 07/11/17:29:13.330 | INFO     | IoService | Creating 16 threads in the executor pool
[TWC: TNTwilsockClient]        -1652717264 | 07/11/17:29:13.333 | DEBUG    | 1      | TNTwilsockClient | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a
[TWC: TNTwilsockClient]        -1652717264 | 07/11/17:29:13.333 | DEBUG    | 1      | TNTwilsockClient | Default thread pool: Available: 16; Capacity: 16
[TWC: TNHttpTransportClient]        -1652717264 | 07/11/17:29:13.335 | INFO     | 4      | TNHttpTransportClient | initialising...
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.335 | INFO     | 1      | TNTwilsockClient | connectImpl >> Disconnected
[TWC: TNHttpTransportClient]        -1652717264 | 07/11/17:29:13.335 | INFO     | 4      | TNHttpTransportClient | initialised
[TWC: TCEmsClient]        -1652717264 | 07/11/17:29:13.335 | DEBUG    | 6      | TCEmsClient | TCEmsClient
[TWC: TCBackoffEmsClient]        -1652717264 | 07/11/17:29:13.335 | DEBUG    | 5      | TCBackoffEmsClient | init
[TWC: TCEmsClient]        -1652717264 | 07/11/17:29:13.335 | DEBUG    | 6      | TCEmsClient | init
[TWC: TCBackoffEmsClient]        -1652717264 | 07/11/17:29:13.335 | DEBUG    | 5      | TCBackoffEmsClient | setToken, eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0LTE1MzEzNDQ1NTMiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJ2ZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0IiwicHVzaF9jcmVkZW50aWFsX3NpZCI6IkNSNTg4OTVkMTg0ZjVkZTY0ZWNlNmY3MGU3NGY3MmM0MTMifX0sImlhdCI6MTUzMTM0NDU1MywiZXhwIjoxNTMxMzQ4MTUzLCJpc3MiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0Iiwic3ViIjoiQUMwYmViMDg1ZDU4YmNmZWE1MDA5NTM2MDE4ZGEzNzkyMyJ9.5fIJowdOWDibCMpgkzARRPGQCEQHHt1XYjpnfEk2Ydk
[TWC: TCBackoffEmsClient]        -1652717264 | 07/11/17:29:13.335 | DEBUG    | 5      | TCBackoffEmsClient | scheduleSetToken
[TWC: TCBackoffEmsClient]        -1652717264 | 07/11/17:29:13.335 | INFO     | 5      | TCBackoffEmsClient | schedule new task
[TWC: TCBackoffEmsClient]        -1657972432 | 07/11/17:29:13.336 | DEBUG    | 5      | TCBackoffEmsClient | internal set token run...
[TWC: TCEmsClient]        -1657972432 | 07/11/17:29:13.336 | DEBUG    | 6      | TCEmsClient | setToken
[TWC: TCEmsClient]        -1657972432 | 07/11/17:29:13.336 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TNTwilsockClientImpl]        -1653782224 | 07/11/17:29:13.336 | DEBUG    | 3      | TNTwilsockClientImpl | connect
[TWC: TNDisconnectedState]        -1653782224 | 07/11/17:29:13.337 | INFO     | 2      | TNDisconnectedState | Leaving state: Disconnected
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.337 | INFO     | 1      | TNTwilsockClient | Change state: Disconnected --> Transport connecting
[TWC: TNTransportConnectingState]        -1653782224 | 07/11/17:29:13.337 | INFO     | 8      | TNTransportConnectingState | Entering state: Transport connecting
[TWC: TNTwilsockClientImpl]        -1653782224 | 07/11/17:29:13.338 | DEBUG    | 3      | TNTwilsockClientImpl | startTransportConnectingTimer
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.338 | INFO     | 1      | TNTwilsockClient | addObserverImpl >> Transport connecting
[TWC: TNTwilsockClientImpl]        -1653782224 | 07/11/17:29:13.338 | DEBUG    | 3      | TNTwilsockClientImpl | addObserver
[TWC: TNHttpTransportClient]        -1653782224 | 07/11/17:29:13.338 | INFO     | 4      | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason
[TWC: TNWebsocket]        -1673860816 | 07/11/17:29:13.338 | DEBUG    | 7      | TNWebsocket | Connecting...
[TWC: TCHttpObserver]        -1657972432 | 07/11/17:29:13.340 | DEBUG    | 9      | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a
[TWC: TNHttpTransportClient]        -1657972432 | 07/11/17:29:13.344 | INFO     | 4      | TNHttpTransportClient | requestId=RQ4f2cd813513b43b3a16bedf7f7d05603, enqueueing request to: https://ems.us1.twilio.com/v1/token
[TWC: TCEmsClient]        -1657972432 | 07/11/17:29:13.345 | DEBUG    | 6      | TCEmsClient | setToken - end
[TWC: TNWebsocket]        -1673860816 | 07/11/17:29:13.345 | DEBUG    | 7      | TNWebsocket | Using proxy : except ()
[TWC: TNWebsocket]        -1673860816 | 07/11/17:29:13.346 | DEBUG    | 7      | TNWebsocket | Trying to establish connection to: https://tsock.us1.twilio.com
[Mono] DllImport searching in: '__Internal' ('(null)').
[Mono] Searching for 'java_interop_jnienv_call_boolean_method'.
[Mono] Probing 'java_interop_jnienv_call_boolean_method'.
[Mono] Found as 'java_interop_jnienv_call_boolean_method'.
[Mono] Assembly Ref addref Xamarin.Android.Support.Core.UI[0x801ec260] -> Xamarin.Android.Support.Compat[0x801d5cd0]: 5
[AbsListView] Get MotionRecognitionManager
[MotionRecognitionManager] mSContextService = null
[MotionRecognitionManager] motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@572443c
[AbsListView] viewType is heaer or footer
[AbsListView] viewType is heaer or footer
[AbsListView]  onsize change 
[libGLESv2] HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
[libGLESv2] HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.709 | INFO     | 1      | TNTwilsockClient | onTransportConnectedImpl >> Transport connecting
[TWC: TNTwilsockClientImpl]        -1653782224 | 07/11/17:29:13.709 | DEBUG    | 3      | TNTwilsockClientImpl | sendInit
[TWC: TNTwilsockClientImpl]        -1653782224 | 07/11/17:29:13.716 | INFO     | 3      | TNTwilsockClientImpl | sendInit, id = 75bdfb317a104a97af211368d9a78b1f8b1f
[TWC: TNWebsocket]        -1673860816 | 07/11/17:29:13.716 | DEBUG    | 7      | TNWebsocket | Sending frame via websocket (637)
[TWC: TNWebsocket] TWILSOCK V3.0 616
[TWC: TNWebsocket] {"id":"75bdfb317a104a97af211368d9a78b1f8b1f","method":"init","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0LTE1MzEzNDQ1NTMiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJ2ZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0IiwicHVzaF9jcmVkZW50aWFsX3NpZCI6IkNSNTg4OTVkMTg0ZjVkZTY0ZWNlNmY3MGU3NGY3MmM0MTMifX0sImlhdCI6MTUzMTM0NDU1MywiZXhwIjoxNTMxMzQ4MTUzLCJpc3MiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0Iiwic3ViIjoiQUMwYmViMDg1ZDU4YmNmZWE1MDA5NTM2MDE4ZGEzNzkyMyJ9.5fIJowdOWDibCMpgkzARRPGQCEQHHt1XYjpnfEk2Ydk"}
[TWC: TNTransportConnectingState]        -1653782224 | 07/11/17:29:13.716 | INFO     | 8      | TNTransportConnectingState | Leaving state: Transport connecting
[TWC: TNTwilsockClientImpl]        -1653782224 | 07/11/17:29:13.717 | DEBUG    | 3      | TNTwilsockClientImpl | stopTransportConnectingTimer
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.717 | INFO     | 1      | TNTwilsockClient | Change state: Transport connecting --> Initialising
[TWC: TNInitialisingState]        -1653782224 | 07/11/17:29:13.717 | INFO     | 10     | TNInitialisingState | Entering state: Initialising
[TWC: TNWebsocket]        -1671722704 | 07/11/17:29:13.804 | DEBUG    | 7      | TNWebsocket | Receive message 190 bytes
[TWC: TNTwilsockClient]        -1671722704 | 07/11/17:29:13.804 | DEBUG    | 1      | TNTwilsockClient | onMessageReceived (225)
[TWC: TNTwilsockClient] TWILSOCK V3.0 204
[TWC: TNTwilsockClient] {"method":"reply","id":"75bdfb317a104a97af211368d9a78b1f8b1f","payload_size":0,"status":{"description":"The authorization with Token failed","errorCode":20151,"code":401,"status":"AUTHENTICATION_FAILED"}}
[TWC: TNTwilsockClient]        -1671722704 | 07/11/17:29:13.805 | INFO     | 1      | TNTwilsockClient | onMessageReceived, method = 8, id = 75bdfb317a104a97af211368d9a78b1f8b1f
[TWC: TNTwilsockClientImpl]        -1671722704 | 07/11/17:29:13.805 | DEBUG    | 3      | TNTwilsockClientImpl | proceedReplyMessage 75bdfb317a104a97af211368d9a78b1f8b1f
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.806 | DEBUG    | 1      | TNTwilsockClient | Reply for '75bdfb317a104a97af211368d9a78b1f8b1f'
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.806 | WARNING  | 1      | TNTwilsockClient | Reply status for init request is not success: 401, AUTHENTICATION_FAILED
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.806 | INFO     | 1      | TNTwilsockClient | ReceivedErrorInitReply >> Initialising
[TWC: TNTwilsockClientImpl]        -1653782224 | 07/11/17:29:13.806 | DEBUG    | 3      | TNTwilsockClientImpl | notifyAboutError
[TWC: TNTwilsockClientImpl]        -1653782224 | 07/11/17:29:13.806 | DEBUG    | 3      | TNTwilsockClientImpl | disconnect
[TWC: TNWebsocket]        -1653782224 | 07/11/17:29:13.806 | DEBUG    | 7      | TNWebsocket | Disconnect
[TWC: TNWebsocket]        -1653782224 | 07/11/17:29:13.806 | DEBUG    | 7      | TNWebsocket | Reset session
[TWC: TNWebsocket]        -1673860816 | 07/11/17:29:13.807 | DEBUG    | 7      | TNWebsocket | Disconnecting...
[TWC: TNWebsocket]        -1671722704 | 07/11/17:29:13.861 | DEBUG    | 7      | TNWebsocket | Receive message 191 bytes
[TWC: TNTwilsockClient]        -1671722704 | 07/11/17:29:13.861 | DEBUG    | 1      | TNTwilsockClient | onMessageReceived (223)
[TWC: TNTwilsockClient] TWILSOCK V3.0 202
[TWC: TNTwilsockClient] {"method":"close","id":"TMf517c43db5774e1393f86ddfe3c60631","payload_size":0,"status":{"description":"The authorization with Token failed","errorCode":20151,"code":401,"status":"AUTHENTICATION_FAILED"}}
[TWC: TNTwilsockClient]        -1671722704 | 07/11/17:29:13.861 | INFO     | 1      | TNTwilsockClient | onMessageReceived, method = 3, id = TMf517c43db5774e1393f86ddfe3c60631
[TWC: TNTwilsockClientImpl]        -1671722704 | 07/11/17:29:13.861 | DEBUG    | 3      | TNTwilsockClientImpl | proceedCloseMessage TMf517c43db5774e1393f86ddfe3c60631
[TWC: TNTwilsockClientImpl]        -1671722704 | 07/11/17:29:13.861 | INFO     | 3      | TNTwilsockClientImpl | Server has just initiated process of closing connection! 401: AUTHENTICATION_FAILED
[TWC: TNWebsocket]        -1673860816 | 07/11/17:29:13.862 | DEBUG    | 7      | TNWebsocket | Disconnected
[TWC: TNTwilsockClient]        -1673860816 | 07/11/17:29:13.863 | DEBUG    | 1      | TNTwilsockClient | onDisconnected
[TWC: TNInitialisingState]        -1653782224 | 07/11/17:29:13.863 | INFO     | 10     | TNInitialisingState | Leaving state: Initialising
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.863 | INFO     | 1      | TNTwilsockClient | Change state: Initialising --> TransportDisconnecting
[TWC: TNTransportDisconnectingState]        -1653782224 | 07/11/17:29:13.863 | INFO     | 11     | TNTransportDisconnectingState | Entering state: TransportDisconnecting
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.863 | INFO     | 1      | TNTwilsockClient | stopUpstreamRequests
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.863 | INFO     | 1      | TNTwilsockClient | sendSuccessReplyImpl >> TransportDisconnecting
[TWC: TNTransportDisconnectingState]        -1653782224 | 07/11/17:29:13.863 | WARNING  | 11     | TNTransportDisconnectingState | Success reply can not be sent. Twilsock is not in connected state
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.863 | INFO     | 1      | TNTwilsockClient | closeRemotelyImpl >> TransportDisconnecting
[TWC: TNTransportDisconnectingState]        -1653782224 | 07/11/17:29:13.863 | WARNING  | 11     | TNTransportDisconnectingState | Disconnect procedure has been already started
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.864 | INFO     | 1      | TNTwilsockClient | onDisconnectedImpl >> TransportDisconnecting
[TWC: TNTransportDisconnectingState]        -1653782224 | 07/11/17:29:13.864 | INFO     | 11     | TNTransportDisconnectingState | Leaving state: TransportDisconnecting
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.864 | INFO     | 1      | TNTwilsockClient | Change state: TransportDisconnecting --> Disconnected
[TWC: TNDisconnectedState]        -1653782224 | 07/11/17:29:13.864 | INFO     | 2      | TNDisconnectedState | Entering state: Disconnected
[TWC: TNTwilsockClientImpl]        -1653782224 | 07/11/17:29:13.864 | DEBUG    | 3      | TNTwilsockClientImpl | notifyAboutDisconnected
[TWC: TNHttpTransportClient]        -1653782224 | 07/11/17:29:13.864 | INFO     | 4      | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.864 | INFO     | 1      | TNTwilsockClient | reset
[TWC: TNWebsocket]        -1653782224 | 07/11/17:29:13.864 | DEBUG    | 7      | TNWebsocket | ~TNWebsocket - begin
[TWC: TNWebsocket]        -1653782224 | 07/11/17:29:13.864 | DEBUG    | 7      | TNWebsocket | Reset session
[TWC: TNWebsocket]        -1673860816 | 07/11/17:29:13.864 | DEBUG    | 7      | TNWebsocket | close
[TWC: TNWebsocket]        -1653782224 | 07/11/17:29:13.864 | DEBUG    | 7      | TNWebsocket | ~TNWebsocket - end
[TWC: TNTwilsockClient]        -1653782224 | 07/11/17:29:13.865 | INFO     | 1      | TNTwilsockClient | stopUpstreamRequests
[TWC: TNHttpTransportClient]        -1654838992 | 07/11/17:29:18.345 | DEBUG    | 4      | TNHttpTransportClient | dequeueing request: RQ4f2cd813513b43b3a16bedf7f7d05603
[TWC: TCHttpObserver]        -1654838992 | 07/11/17:29:18.345 | DEBUG    | 9      | TCHttpObserver | onFailed - begin
[TWC: TCHttpObserver]        -1654838992 | 07/11/17:29:18.345 | WARNING  | 9      | TCHttpObserver | Request has failed: Transport connection closed (3)
[TWC: TCHttpObserver]        -1654838992 | 07/11/17:29:18.345 | DEBUG    | 9      | TCHttpObserver | setPromise - 3
[TWC: TCBackoffEmsClient]        -1654838992 | 07/11/17:29:18.345 | DEBUG    | 5      | TCBackoffEmsClient | internal set token result: 3
[TWC: TCEmsClient]        -1654838992 | 07/11/17:29:18.346 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TCHttpObserver]        -1654838992 | 07/11/17:29:18.346 | DEBUG    | 9      | TCHttpObserver | onFailed - end
[TWC: TCHttpObserver]        -1654838992 | 07/11/17:29:18.346 | DEBUG    | 9      | TCHttpObserver | ~TCHttpObserver - begin
[TWC: TCHttpObserver]        -1654838992 | 07/11/17:29:18.346 | DEBUG    | 9      | TCHttpObserver | ~TCHttpObserver - end
[TWC: TCBackoffEmsClient]        -1654838992 | 07/11/17:29:18.346 | DEBUG    | 5      | TCBackoffEmsClient | internal set token run...
[TWC: TCEmsClient]        -1654838992 | 07/11/17:29:18.346 | DEBUG    | 6      | TCEmsClient | setToken
[TWC: TCEmsClient]        -1654838992 | 07/11/17:29:18.346 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TCHttpObserver]        -1654838992 | 07/11/17:29:18.347 | DEBUG    | 12     | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a
[TWC: TNHttpTransportClient]        -1654838992 | 07/11/17:29:18.353 | INFO     | 4      | TNHttpTransportClient | requestId=RQ3349329a9bb34d4a89d05e95e7c814d5, enqueueing request to: https://ems.us1.twilio.com/v1/token
[TWC: TCEmsClient]        -1654838992 | 07/11/17:29:18.354 | DEBUG    | 6      | TCEmsClient | setToken - end
[TWC: TNHttpTransportClient]        -1666389712 | 07/11/17:29:23.357 | DEBUG    | 4      | TNHttpTransportClient | dequeueing request: RQ3349329a9bb34d4a89d05e95e7c814d5
[TWC: TCHttpObserver]        -1666389712 | 07/11/17:29:23.358 | DEBUG    | 12     | TCHttpObserver | onFailed - begin
[TWC: TCHttpObserver]        -1666389712 | 07/11/17:29:23.358 | WARNING  | 12     | TCHttpObserver | Request has failed: Transport connection closed (3)
[TWC: TCHttpObserver]        -1666389712 | 07/11/17:29:23.358 | DEBUG    | 12     | TCHttpObserver | setPromise - 3
[TWC: TCBackoffEmsClient]        -1666389712 | 07/11/17:29:23.358 | DEBUG    | 5      | TCBackoffEmsClient | internal set token result: 3
[TWC: TCEmsClient]        -1666389712 | 07/11/17:29:23.358 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TCHttpObserver]        -1666389712 | 07/11/17:29:23.358 | DEBUG    | 12     | TCHttpObserver | onFailed - end
[TWC: TCHttpObserver]        -1666389712 | 07/11/17:29:23.358 | DEBUG    | 12     | TCHttpObserver | ~TCHttpObserver - begin
[TWC: TCHttpObserver]        -1666389712 | 07/11/17:29:23.358 | DEBUG    | 12     | TCHttpObserver | ~TCHttpObserver - end
[TWC: TCBackoffEmsClient]        -1666389712 | 07/11/17:29:23.358 | DEBUG    | 5      | TCBackoffEmsClient | internal set token run...
[TWC: TCEmsClient]        -1666389712 | 07/11/17:29:23.358 | DEBUG    | 6      | TCEmsClient | setToken
[TWC: TCEmsClient]        -1666389712 | 07/11/17:29:23.358 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TCHttpObserver]        -1666389712 | 07/11/17:29:23.359 | DEBUG    | 13     | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a
[TWC: TNHttpTransportClient]        -1666389712 | 07/11/17:29:23.365 | INFO     | 4      | TNHttpTransportClient | requestId=RQa0bd4191e81241c98da7c5f44a7e4fed, enqueueing request to: https://ems.us1.twilio.com/v1/token
[TWC: TCEmsClient]        -1666389712 | 07/11/17:29:23.365 | DEBUG    | 6      | TCEmsClient | setToken - end
[TWC: TNHttpTransportClient]        -1660061392 | 07/11/17:29:28.369 | DEBUG    | 4      | TNHttpTransportClient | dequeueing request: RQa0bd4191e81241c98da7c5f44a7e4fed
[TWC: TCHttpObserver]        -1660061392 | 07/11/17:29:28.369 | DEBUG    | 13     | TCHttpObserver | onFailed - begin
[TWC: TCHttpObserver]        -1660061392 | 07/11/17:29:28.369 | WARNING  | 13     | TCHttpObserver | Request has failed: Transport connection closed (3)
[TWC: TCHttpObserver]        -1660061392 | 07/11/17:29:28.369 | DEBUG    | 13     | TCHttpObserver | setPromise - 3
[TWC: TCBackoffEmsClient]        -1660061392 | 07/11/17:29:28.369 | DEBUG    | 5      | TCBackoffEmsClient | internal set token result: 3
[TWC: TCBackoffEmsClient]        -1660061392 | 07/11/17:29:28.369 | INFO     | 5      | TCBackoffEmsClient | backoff result: 2 - 'Time is exceeded', setToken result: 3
[TWC: TCBackoffEmsClient]        -1660061392 | 07/11/17:29:28.370 | DEBUG    | 5      | TCBackoffEmsClient | scheduleSetToken
[TWC: TCEmsClient]        -1660061392 | 07/11/17:29:28.370 | DEBUG    | 6      | TCEmsClient | runGenerateTokenTask
[TWC: TCHttpObserver]        -1660061392 | 07/11/17:29:28.370 | DEBUG    | 13     | TCHttpObserver | onFailed - end
[TWC: TCHttpObserver]        -1660061392 | 07/11/17:29:28.370 | DEBUG    | 13     | TCHttpObserver | ~TCHttpObserver - begin
[TWC: TCHttpObserver]        -1660061392 | 07/11/17:29:28.370 | DEBUG    | 13     | TCHttpObserver | ~TCHttpObserver - end
[jni_mate] Got method ID 0xa04b6e80 for method <init>(ILjava/lang/String;)V
[TWC: TNTwilsockClient]        -1652717264 | 07/11/17:29:28.374 | DEBUG    | 1      | TNTwilsockClient | ~TNTwilsockClient - begin
[TWC: TNTwilsockClient]        -1652717264 | 07/11/17:29:28.374 | DEBUG    | 1      | TNTwilsockClient | Cleaning observers list - begin
[TWC: TNTwilsockClient]        -1652717264 | 07/11/17:29:28.374 | DEBUG    | 1      | TNTwilsockClient | Cleaning observers list - end
[TWC: TNTwilsockClient]        -1652717264 | 07/11/17:29:28.374 | DEBUG    | 1      | TNTwilsockClient | cleanup_threads - begin
[TWC: TNTwilsockClient]        -1652717264 | 07/11/17:29:28.374 | DEBUG    | 1      | TNTwilsockClient | Default thread pool: Available: 16; Capacity: 16
[TWC: TNTwilsockClient]        -1652717264 | 07/11/17:29:28.375 | DEBUG    | 1      | TNTwilsockClient | cleanup_threads - end
[TWC: TNTwilsockClient]        -1652717264 | 07/11/17:29:28.375 | DEBUG    | 1      | TNTwilsockClient | ~TNTwilsockClient - end
[TWC: TNTwilsockClientImpl]        -1652717264 | 07/11/17:29:28.375 | DEBUG    | 3      | TNTwilsockClientImpl | destructed
[art] Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[29,tid=31320,Native,Thread*=0x80dea7f8,peer=0x130290a0,"amarin.ChatDemo - 31320"]
[2018-07-11 17:29:28.383] [ERROR] [ChatClientCallbackListener] Error 0:3 Request to EMS service has failed, unable to set FPA token
berkus commented 6 years ago

Check that your account SID and secret key SID match. Also check that this service SID belongs to the account. Maybe there's a typo?

I could check in more details on monday.

ghost commented 6 years ago

image

image

@berkus - you were right...i did have the wrong push credential. But posted above is images proving that i fix the push credential issue (i only put the beginning parts of the credential in the pic)...but i am still seeing the same problem....

this is the token returned: Got chat token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0LTE1MzE4NDQ3MTgiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJ2ZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0IiwicHVzaF9jcmVkZW50aWFsX3NpZCI6IkNSMmIwZTkzYjNjYzI1MTVkMGY5MDNmNWQ3ZDEzNjliYWQifX0sImlhdCI6MTUzMTg0NDcxOCwiZXhwIjoxNTMxODQ4MzE4LCJpc3MiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0Iiwic3ViIjoiQUMwYmViMDg1ZDU4YmNmZWE1MDA5NTM2MDE4ZGEzNzkyMyJ9.2Q9U9P2Ui2C4vvd_lcNq3Dlk6a_n9PdTvtWcp787EjI

below is the token i got back when i removed the push credential...(same issue)

Got chat token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTSzA0ZTM3YWE4ZDJiMGQwYjg4NzhhZTY4MTExODJlMmM0LTE1MzE4NDU2MjMiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJ2ZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0In19LCJpYXQiOjE1MzE4NDU2MjMsImV4cCI6MTUzMTg0OTIyMywiaXNzIjoiU0swNGUzN2FhOGQyYjBkMGI4ODc4YWU2ODExMTgyZTJjNCIsInN1YiI6IkFDMGJlYjA4NWQ1OGJjZmVhNTAwOTUzNjAxOGRhMzc5MjMifQ.IMFyM2vba-q-k09jPuQ3lQCamZHZNo755qk5G28kkgY [ChatClient] Twilio Chat SDK version 3.0.0

berkus commented 6 years ago

@Daron-Rice and @jetri please do check that you are using proper non-revoked signing keys (the ones with SKxxxx SIDs) and update your token generator to use correct ones.

ghost commented 6 years ago

i had a stale api key...but after swapping it out, i still had the same issue...here is where is the logs and where i am getting the values from:

image

image

image

image

image

berkus commented 6 years ago

This doesn't tell me much, but another round of logs could help.

ghost commented 6 years ago

here is the most recent logs....

[TWC:] -1652070096 | 07/20/12:25:52.304 | DEBUG | | Using root certificate store: /data/user/0/com.twilio.rtd.xamarin.ChatDemo/files/rootcert.pem [TWC: IoService] -1652070096 | 07/20/12:25:52.319 | INFO | IoService | Creating 16 threads in the executor pool [TWC: TNTwilsockClient] -1652070096 | 07/20/12:25:52.322 | DEBUG | 1 | TNTwilsockClient | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a [TWC: TNTwilsockClient] -1652070096 | 07/20/12:25:52.323 | DEBUG | 1 | TNTwilsockClient | Default thread pool: Available: 16; Capacity: 16 [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.324 | INFO | 1 | TNTwilsockClient | connectImpl >> Disconnected [TWC: TNHttpTransportClient] -1652070096 | 07/20/12:25:52.324 | INFO | 4 | TNHttpTransportClient | initialising... [TWC: TNHttpTransportClient] -1652070096 | 07/20/12:25:52.324 | INFO | 4 | TNHttpTransportClient | initialised [TWC: TNTwilsockClientImpl] -1653135056 | 07/20/12:25:52.325 | DEBUG | 3 | TNTwilsockClientImpl | connect [TWC: TCEmsClient] -1652070096 | 07/20/12:25:52.325 | DEBUG | 7 | TCEmsClient | TCEmsClient [TWC: TCBackoffEmsClient] -1652070096 | 07/20/12:25:52.325 | DEBUG | 5 | TCBackoffEmsClient | init [TWC: TCEmsClient] -1652070096 | 07/20/12:25:52.325 | DEBUG | 7 | TCEmsClient | init [TWC: TNDisconnectedState] -1653135056 | 07/20/12:25:52.325 | INFO | 2 | TNDisconnectedState | Leaving state: Disconnected [TWC: TCBackoffEmsClient] -1652070096 | 07/20/12:25:52.325 | DEBUG | 5 | TCBackoffEmsClient | setToken, eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2EzM2I0ZjA1N2U1MTYzNjZmODUwMTUzODljMjhhMjM3LTE1MzIxMDM5NTEiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJ2ZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0IiwicHVzaF9jcmVkZW50aWFsX3NpZCI6IkNSMmIwZTkzYjNjYzI1MTVkMGY5MDNmNWQ3ZDEzNjliYWQifX0sImlhdCI6MTUzMjEwMzk1MSwiZXhwIjoxNTMyMTA3NTUxLCJpc3MiOiJTS2EzM2I0ZjA1N2U1MTYzNjZmODUwMTUzODljMjhhMjM3Iiwic3ViIjoiQUMwYmViMDg1ZDU4YmNmZWE1MDA5NTM2MDE4ZGEzNzkyMyJ9.4gd0i0s0CI6_Rg2TtVL9rbRnXD_LoAOSg6H2L9cxPXA [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.325 | INFO | 1 | TNTwilsockClient | Change state: Disconnected --> Transport connecting [TWC: TCBackoffEmsClient] -1652070096 | 07/20/12:25:52.325 | DEBUG | 5 | TCBackoffEmsClient | scheduleSetToken [TWC: TNTransportConnectingState] -1653135056 | 07/20/12:25:52.325 | INFO | 8 | TNTransportConnectingState | Entering state: Transport connecting [TWC: TCBackoffEmsClient] -1652070096 | 07/20/12:25:52.325 | INFO | 5 | TCBackoffEmsClient | schedule new task [TWC: TNTwilsockClientImpl] -1653135056 | 07/20/12:25:52.325 | DEBUG | 3 | TNTwilsockClientImpl | startTransportConnectingTimer [TWC: TCBackoffEmsClient] -1659401936 | 07/20/12:25:52.325 | DEBUG | 5 | TCBackoffEmsClient | internal set token run... [TWC: TCEmsClient] -1659401936 | 07/20/12:25:52.326 | DEBUG | 7 | TCEmsClient | setToken [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.326 | INFO | 1 | TNTwilsockClient | addObserverImpl >> Transport connecting [TWC: TNTwilsockClientImpl] -1653135056 | 07/20/12:25:52.326 | DEBUG | 3 | TNTwilsockClientImpl | addObserver [TWC: TNHttpTransportClient] -1653135056 | 07/20/12:25:52.326 | INFO | 4 | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason [TWC: TNWebsocket] -1673213648 | 07/20/12:25:52.326 | DEBUG | 6 | TNWebsocket | Connecting... [TWC: TNWebsocket] -1673213648 | 07/20/12:25:52.326 | DEBUG | 6 | TNWebsocket | Using proxy : except () [TWC: TNWebsocket] -1673213648 | 07/20/12:25:52.326 | DEBUG | 6 | TNWebsocket | Trying to establish connection to: https://tsock.us1.twilio.com [TWC: TCEmsClient] -1659401936 | 07/20/12:25:52.326 | DEBUG | 7 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -1659401936 | 07/20/12:25:52.330 | DEBUG | 9 | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a [TWC: TNHttpTransportClient] -1659401936 | 07/20/12:25:52.334 | INFO | 4 | TNHttpTransportClient | requestId=RQb86c36fecee84b28bbe436163ac85ef6, enqueueing request to: https://ems.us1.twilio.com/v1/token [TWC: TCEmsClient] -1659401936 | 07/20/12:25:52.335 | DEBUG | 7 | TCEmsClient | setToken - end [Mono] DllImport searching in: '__Internal' ('(null)'). [Mono] Searching for 'java_interop_jnienv_call_boolean_method'. [Mono] Probing 'java_interop_jnienv_call_boolean_method'. [Mono] Found as 'java_interop_jnienv_call_boolean_method'.

[AbsListView] Get MotionRecognitionManager [MotionRecognitionManager] mSContextService = null [MotionRecognitionManager] motionService = com.samsung.android.motion.IMotionRecognitionService$Stub$Proxy@e449ff8 [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.549 | INFO | 1 | TNTwilsockClient | onTransportConnectedImpl >> Transport connecting [TWC: TNTwilsockClientImpl] -1653135056 | 07/20/12:25:52.549 | DEBUG | 3 | TNTwilsockClientImpl | sendInit [TWC: TNTwilsockClientImpl] -1653135056 | 07/20/12:25:52.554 | INFO | 3 | TNTwilsockClientImpl | sendInit, id = 586aa9a2c8ac455095f3c27ec1b09cba9cba [TWC: TNTransportConnectingState] -1653135056 | 07/20/12:25:52.554 | INFO | 8 | TNTransportConnectingState | Leaving state: Transport connecting [TWC: TNWebsocket] -1673213648 | 07/20/12:25:52.554 | DEBUG | 6 | TNWebsocket | Sending frame via websocket (637) [TWC: TNWebsocket] TWILSOCK V3.0 616 [TWC: TNWebsocket] {"id":"586aa9a2c8ac455095f3c27ec1b09cba9cba","method":"init","token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2EzM2I0ZjA1N2U1MTYzNjZmODUwMTUzODljMjhhMjM3LTE1MzIxMDM5NTEiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJ2ZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0IiwicHVzaF9jcmVkZW50aWFsX3NpZCI6IkNSMmIwZTkzYjNjYzI1MTVkMGY5MDNmNWQ3ZDEzNjliYWQifX0sImlhdCI6MTUzMjEwMzk1MSwiZXhwIjoxNTMyMTA3NTUxLCJpc3MiOiJTS2EzM2I0ZjA1N2U1MTYzNjZmODUwMTUzODljMjhhMjM3Iiwic3ViIjoiQUMwYmViMDg1ZDU4YmNmZWE1MDA5NTM2MDE4ZGEzNzkyMyJ9.4gd0i0s0CI6_Rg2TtVL9rbRnXD_LoAOSg6H2L9cxPXA"} [TWC: TNTwilsockClientImpl] -1653135056 | 07/20/12:25:52.555 | DEBUG | 3 | TNTwilsockClientImpl | stopTransportConnectingTimer [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.555 | INFO | 1 | TNTwilsockClient | Change state: Transport connecting --> Initialising [TWC: TNInitialisingState] -1653135056 | 07/20/12:25:52.555 | INFO | 10 | TNInitialisingState | Entering state: Initialising [TWC: TNWebsocket] -1671100112 | 07/20/12:25:52.598 | DEBUG | 6 | TNWebsocket | Receive message 195 bytes [TWC: TNTwilsockClient] -1671100112 | 07/20/12:25:52.598 | DEBUG | 1 | TNTwilsockClient | onMessageReceived (225) [TWC: TNTwilsockClient] TWILSOCK V3.0 204 [TWC: TNTwilsockClient] {"method":"reply","id":"586aa9a2c8ac455095f3c27ec1b09cba9cba","payload_size":0,"status":{"description":"Invalid Access Token issuer/subject","errorCode":20103,"code":401,"status":"AUTHENTICATION_FAILED"}} [TWC: TNTwilsockClient] -1671100112 | 07/20/12:25:52.598 | INFO | 1 | TNTwilsockClient | onMessageReceived, method = 8, id = 586aa9a2c8ac455095f3c27ec1b09cba9cba [TWC: TNTwilsockClientImpl] -1671100112 | 07/20/12:25:52.598 | DEBUG | 3 | TNTwilsockClientImpl | proceedReplyMessage 586aa9a2c8ac455095f3c27ec1b09cba9cba [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.598 | DEBUG | 1 | TNTwilsockClient | Reply for '586aa9a2c8ac455095f3c27ec1b09cba9cba' [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.598 | WARNING | 1 | TNTwilsockClient | Reply status for init request is not success: 401, AUTHENTICATION_FAILED [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.598 | INFO | 1 | TNTwilsockClient | ReceivedErrorInitReply >> Initialising [TWC: TNTwilsockClientImpl] -1653135056 | 07/20/12:25:52.599 | DEBUG | 3 | TNTwilsockClientImpl | notifyAboutError [TWC: TNTwilsockClientImpl] -1653135056 | 07/20/12:25:52.599 | DEBUG | 3 | TNTwilsockClientImpl | disconnect [TWC: TNWebsocket] -1653135056 | 07/20/12:25:52.599 | DEBUG | 6 | TNWebsocket | Disconnect [TWC: TNWebsocket] -1653135056 | 07/20/12:25:52.599 | DEBUG | 6 | TNWebsocket | Reset session [TWC: TNWebsocket] -1673213648 | 07/20/12:25:52.599 | DEBUG | 6 | TNWebsocket | Disconnecting... [AbsListView] viewType is heaer or footer [TWC: TNWebsocket] -1671100112 | 07/20/12:25:52.598 | DEBUG | 6 | TNWebsocket | Receive message 193 bytes [TWC: TNTwilsockClient] -1671100112 | 07/20/12:25:52.599 | DEBUG | 1 | TNTwilsockClient | onMessageReceived (223) [TWC: TNTwilsockClient] TWILSOCK V3.0 202 [TWC: TNTwilsockClient] {"method":"close","id":"TMc3c4ff51a83b435c957798d3e90a3917","payload_size":0,"status":{"description":"Invalid Access Token issuer/subject","errorCode":20103,"code":401,"status":"AUTHENTICATION_FAILED"}} [TWC: TNTwilsockClient] -1671100112 | 07/20/12:25:52.599 | INFO | 1 | TNTwilsockClient | onMessageReceived, method = 3, id = TMc3c4ff51a83b435c957798d3e90a3917 [TWC: TNTwilsockClientImpl] -1671100112 | 07/20/12:25:52.600 | DEBUG | 3 | TNTwilsockClientImpl | proceedCloseMessage TMc3c4ff51a83b435c957798d3e90a3917 [TWC: TNTwilsockClientImpl] -1671100112 | 07/20/12:25:52.600 | INFO | 3 | TNTwilsockClientImpl | Server has just initiated process of closing connection! 401: AUTHENTICATION_FAILED [TWC: TNWebsocket] -1673213648 | 07/20/12:25:52.600 | DEBUG | 6 | TNWebsocket | Disconnected [TWC: TNTwilsockClient] -1673213648 | 07/20/12:25:52.601 | DEBUG | 1 | TNTwilsockClient | onDisconnected [TWC: TNInitialisingState] -1653135056 | 07/20/12:25:52.601 | INFO | 10 | TNInitialisingState | Leaving state: Initialising [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.601 | INFO | 1 | TNTwilsockClient | Change state: Initialising --> TransportDisconnecting [TWC: TNTransportDisconnectingState] -1653135056 | 07/20/12:25:52.601 | INFO | 11 | TNTransportDisconnectingState | Entering state: TransportDisconnecting [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.601 | INFO | 1 | TNTwilsockClient | stopUpstreamRequests [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.601 | INFO | 1 | TNTwilsockClient | sendSuccessReplyImpl >> TransportDisconnecting [TWC: TNTransportDisconnectingState] -1653135056 | 07/20/12:25:52.601 | WARNING | 11 | TNTransportDisconnectingState | Success reply can not be sent. Twilsock is not in connected state [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.601 | INFO | 1 | TNTwilsockClient | closeRemotelyImpl >> TransportDisconnecting [TWC: TNTransportDisconnectingState] -1653135056 | 07/20/12:25:52.601 | WARNING | 11 | TNTransportDisconnectingState | Disconnect procedure has been already started [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.601 | INFO | 1 | TNTwilsockClient | onDisconnectedImpl >> TransportDisconnecting [TWC: TNTransportDisconnectingState] -1653135056 | 07/20/12:25:52.601 | INFO | 11 | TNTransportDisconnectingState | Leaving state: TransportDisconnecting [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.601 | INFO | 1 | TNTwilsockClient | Change state: TransportDisconnecting --> Disconnected [TWC: TNDisconnectedState] -1653135056 | 07/20/12:25:52.601 | INFO | 2 | TNDisconnectedState | Entering state: Disconnected [TWC: TNTwilsockClientImpl] -1653135056 | 07/20/12:25:52.601 | DEBUG | 3 | TNTwilsockClientImpl | notifyAboutDisconnected [TWC: TNHttpTransportClient] -1653135056 | 07/20/12:25:52.601 | INFO | 4 | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.601 | INFO | 1 | TNTwilsockClient | reset [TWC: TNWebsocket] -1653135056 | 07/20/12:25:52.601 | DEBUG | 6 | TNWebsocket | ~TNWebsocket - begin [TWC: TNWebsocket] -1653135056 | 07/20/12:25:52.601 | DEBUG | 6 | TNWebsocket | Reset session [TWC: TNWebsocket] -1673213648 | 07/20/12:25:52.602 | DEBUG | 6 | TNWebsocket | close [TWC: TNWebsocket] -1653135056 | 07/20/12:25:52.602 | DEBUG | 6 | TNWebsocket | ~TNWebsocket - end [TWC: TNTwilsockClient] -1653135056 | 07/20/12:25:52.602 | INFO | 1 | TNTwilsockClient | stopUpstreamRequests [AbsListView] viewType is heaer or footer [AbsListView] onsize change [libGLESv2] HWUI Protection: wrong call from hwui context F: ES3-glCreateProgramSEC [TWC: TNHttpTransportClient] -1661490896 | 07/20/12:25:57.335 | DEBUG | 4 | TNHttpTransportClient | dequeueing request: RQb86c36fecee84b28bbe436163ac85ef6 [TWC: TCHttpObserver] -1661490896 | 07/20/12:25:57.335 | DEBUG | 9 | TCHttpObserver | onFailed - begin [TWC: TCHttpObserver] -1661490896 | 07/20/12:25:57.335 | WARNING | 9 | TCHttpObserver | Request has failed: Transport connection closed (3) [TWC: TCHttpObserver] -1661490896 | 07/20/12:25:57.335 | DEBUG | 9 | TCHttpObserver | setPromise - 3 [TWC: TCBackoffEmsClient] -1661490896 | 07/20/12:25:57.335 | DEBUG | 5 | TCBackoffEmsClient | internal set token result: 3 [TWC: TCEmsClient] -1661490896 | 07/20/12:25:57.335 | DEBUG | 7 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -1661490896 | 07/20/12:25:57.335 | DEBUG | 9 | TCHttpObserver | onFailed - end [TWC: TCHttpObserver] -1661490896 | 07/20/12:25:57.335 | DEBUG | 9 | TCHttpObserver | ~TCHttpObserver - begin [TWC: TCHttpObserver] -1661490896 | 07/20/12:25:57.336 | DEBUG | 9 | TCHttpObserver | ~TCHttpObserver - end [TWC: TCBackoffEmsClient] -1661490896 | 07/20/12:25:57.336 | DEBUG | 5 | TCBackoffEmsClient | internal set token run... [TWC: TCEmsClient] -1661490896 | 07/20/12:25:57.336 | DEBUG | 7 | TCEmsClient | setToken [TWC: TCEmsClient] -1661490896 | 07/20/12:25:57.336 | DEBUG | 7 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -1661490896 | 07/20/12:25:57.337 | DEBUG | 12 | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a [TWC: TNHttpTransportClient] -1661490896 | 07/20/12:25:57.343 | INFO | 4 | TNHttpTransportClient | requestId=RQ11983fb1043944f484a8420e0f50d016, enqueueing request to: https://ems.us1.twilio.com/v1/token [TWC: TCEmsClient] -1661490896 | 07/20/12:25:57.343 | DEBUG | 7 | TCEmsClient | setToken - end [TWC: TNHttpTransportClient] -1660446416 | 07/20/12:26:02.347 | DEBUG | 4 | TNHttpTransportClient | dequeueing request: RQ11983fb1043944f484a8420e0f50d016 [TWC: TCHttpObserver] -1660446416 | 07/20/12:26:02.347 | DEBUG | 12 | TCHttpObserver | onFailed - begin [TWC: TCHttpObserver] -1660446416 | 07/20/12:26:02.347 | WARNING | 12 | TCHttpObserver | Request has failed: Transport connection closed (3) [TWC: TCHttpObserver] -1660446416 | 07/20/12:26:02.347 | DEBUG | 12 | TCHttpObserver | setPromise - 3 [TWC: TCBackoffEmsClient] -1660446416 | 07/20/12:26:02.347 | DEBUG | 5 | TCBackoffEmsClient | internal set token result: 3 [TWC: TCEmsClient] -1660446416 | 07/20/12:26:02.347 | DEBUG | 7 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -1660446416 | 07/20/12:26:02.347 | DEBUG | 12 | TCHttpObserver | onFailed - end [TWC: TCHttpObserver] -1660446416 | 07/20/12:26:02.348 | DEBUG | 12 | TCHttpObserver | ~TCHttpObserver - begin [TWC: TCHttpObserver] -1660446416 | 07/20/12:26:02.348 | DEBUG | 12 | TCHttpObserver | ~TCHttpObserver - end [TWC: TCBackoffEmsClient] -1660446416 | 07/20/12:26:02.348 | DEBUG | 5 | TCBackoffEmsClient | internal set token run... [TWC: TCEmsClient] -1660446416 | 07/20/12:26:02.348 | DEBUG | 7 | TCEmsClient | setToken [TWC: TCEmsClient] -1660446416 | 07/20/12:26:02.348 | DEBUG | 7 | TCEmsClient | runGenerateTokenTask [TWC: TCHttpObserver] -1660446416 | 07/20/12:26:02.349 | DEBUG | 13 | TCHttpObserver | client: version: 2.5.2, build id: 262, build branch: refs/heads/master, os: android, arch: armeabi-v7a [TWC: TNHttpTransportClient] -1660446416 | 07/20/12:26:02.356 | INFO | 4 | TNHttpTransportClient | requestId=RQ905ce84485ef49c98d0a39bfeb1a4f26, enqueueing request to: https://ems.us1.twilio.com/v1/token [TWC: TCEmsClient] -1660446416 | 07/20/12:26:02.356 | DEBUG | 7 | TCEmsClient | setToken - end [TWC: TNHttpTransportClient] -1664734928 | 07/20/12:26:07.360 | DEBUG | 4 | TNHttpTransportClient | dequeueing request: RQ905ce84485ef49c98d0a39bfeb1a4f26 [TWC: TCHttpObserver] -1664734928 | 07/20/12:26:07.360 | DEBUG | 13 | TCHttpObserver | onFailed - begin [TWC: TCHttpObserver] -1664734928 | 07/20/12:26:07.360 | WARNING | 13 | TCHttpObserver | Request has failed: Transport connection closed (3) [TWC: TCHttpObserver] -1664734928 | 07/20/12:26:07.361 | DEBUG | 13 | TCHttpObserver | setPromise - 3 [TWC: TCBackoffEmsClient] -1664734928 | 07/20/12:26:07.361 | DEBUG | 5 | TCBackoffEmsClient | internal set token result: 3 [TWC: TCBackoffEmsClient] -1664734928 | 07/20/12:26:07.361 | INFO | 5 | TCBackoffEmsClient | backoff result: 2 - 'Time is exceeded', setToken result: 3 [TWC: TCBackoffEmsClient] -1664734928 | 07/20/12:26:07.361 | DEBUG | 5 | TCBackoffEmsClient | scheduleSetToken [TWC: TCEmsClient] -1664734928 | 07/20/12:26:07.361 | DEBUG | 7 | TCEmsClient | runGenerateTokenTask [jni_mate] Got method ID 0xa04a6e80 for method (ILjava/lang/String;)V [TWC: TCHttpObserver] -1664734928 | 07/20/12:26:07.361 | DEBUG | 13 | TCHttpObserver | onFailed - end [TWC: TCHttpObserver] -1664734928 | 07/20/12:26:07.361 | DEBUG | 13 | TCHttpObserver | ~TCHttpObserver - begin [TWC: TCHttpObserver] -1664734928 | 07/20/12:26:07.361 | DEBUG | 13 | TCHttpObserver | ~TCHttpObserver - end [TWC: TNTwilsockClient] -1652070096 | 07/20/12:26:07.361 | DEBUG | 1 | TNTwilsockClient | ~TNTwilsockClient - begin [TWC: TNTwilsockClient] -1652070096 | 07/20/12:26:07.361 | DEBUG | 1 | TNTwilsockClient | Cleaning observers list - begin [TWC: TNTwilsockClient] -1652070096 | 07/20/12:26:07.361 | DEBUG | 1 | TNTwilsockClient | Cleaning observers list - end [TWC: TNTwilsockClient] -1652070096 | 07/20/12:26:07.362 | DEBUG | 1 | TNTwilsockClient | cleanup_threads - begin [TWC: TNTwilsockClient] -1652070096 | 07/20/12:26:07.362 | DEBUG | 1 | TNTwilsockClient | Default thread pool: Available: 16; Capacity: 16 [TWC: TNTwilsockClient] -1652070096 | 07/20/12:26:07.362 | DEBUG | 1 | TNTwilsockClient | cleanup_threads - end [TWC: TNTwilsockClient] -1652070096 | 07/20/12:26:07.362 | DEBUG | 1 | TNTwilsockClient | ~TNTwilsockClient - end [TWC: TNTwilsockClientImpl] -1652070096 | 07/20/12:26:07.362 | DEBUG | 3 | TNTwilsockClientImpl | destructed [art] Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[28,tid=29866,Native,Thread*=0x82014a00,peer=0x12f3e0a0,"amarin.ChatDemo - 29866"] [2018-07-20 12:26:07.371] [ERROR] [ChatClientCallbackListener] Error 0:3 Request to EMS service has failed, unable to set FPA token

berkus commented 6 years ago

"description":"Invalid Access Token issuer/subject"

I presume you've used unrelated Account and secret key, check your values:

"iss": "SKa33b4f057e516366f85015389c28a237",
"sub": "AC0beb085d58bcfea5009536018da37923"
ghost commented 6 years ago

"SKa33b4f057e516366f85015389c28a237" - i had been using this as the api key instead of the secret(according to your last message, it should be the secret, not the key)...i going to try swapped the key and secret around then posting the logs if it is not successful.

berkus commented 6 years ago

Well, they seem to be in the right positions, issuer is the secret key and subject is the account.

I mean you may be using a wrong key that is not for your account. (SK is only the SID, be sure to match the actual secret key and it's sid, too)

ghost commented 6 years ago

i am using these values

REDACTED

berkus commented 6 years ago

Well, now that you’ve exposed your secret signing key to the entire internet you will have to revoke that key and generate a new one. When you do that, please make sure it is associated with the correct account SID.

Please note: Repeatedly exposing critical security-sensitive information may lead to suspension of your account.

ghost commented 6 years ago

ok...understood....Posting another round of logs...token has been left out due to your last post.

.119 ChatDemo.iOS[406:137153] <<<<TwilioChatClient: 0x10c3bb5d0>>>> IoService[3]: 0x16ed3f000 | 07/24/13:50:35.117 | INFO | IoService | Creating 16 threads in the executor pool 2018-07-24 13:50:35.125 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.125 | INFO | 1 | TNTwilsockClient | connectImpl >> Disconnected 2018-07-24 13:50:35.126 ChatDemo.iOS[406:137153] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNHttpTransportClient[3]: 0x16ed3f000 | 07/24/13:50:35.126 | INFO | 4 | TNHttpTransportClient | initialising... 2018-07-24 13:50:35.127 ChatDemo.iOS[406:137153] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNHttpTransportClient[3]: 0x16ed3f000 | 07/24/13:50:35.127 | INFO | 4 | TNHttpTransportClient | initialised 2018-07-24 13:50:35.128 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNDisconnectedState[3]: 0x1704df000 | 07/24/13:50:35.128 | INFO | 2 | TNDisconnectedState | Leaving state: Disconnected 2018-07-24 13:50:35.128 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.128 | INFO | 1 | TNTwilsockClient | Change state: Disconnected --> Transport connecting 2018-07-24 13:50:35.130 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTransportConnectingState[3]: 0x1704df000 | 07/24/13:50:35.128 | INFO | 6 | TNTransportConnectingState | Entering state: Transport connecting 2018-07-24 13:50:35.131 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.131 | INFO | 1 | TNTwilsockClient | addObserverImpl >> Transport connecting 2018-07-24 13:50:35.132 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNHttpTransportClient[3]: 0x1704df000 | 07/24/13:50:35.132 | INFO | 4 | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason 2018-07-24 13:50:35.142 ChatDemo.iOS[406:137153] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TCBackoffEmsClient[3]: 0x16ed3f000 | 07/24/13:50:35.141 | INFO | 7 | TCBackoffEmsClient | schedule new task 2018-07-24 13:50:35.155 ChatDemo.iOS[406:137529] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNHttpTransportClient[3]: 0x17056b000 | 07/24/13:50:35.155 | INFO | 4 | TNHttpTransportClient | requestId=RQb86e0f96702643aa89fbdc083a886d3f, enqueueing request to: https://ems.us1.twilio.com/v1/token 2018-07-24 13:50:35.309 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.308 | INFO | 1 | TNTwilsockClient | onTransportConnectedImpl >> Transport connecting 2018-07-24 13:50:35.321 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClientImpl[3]: 0x1704df000 | 07/24/13:50:35.321 | INFO | 3 | TNTwilsockClientImpl | sendInit, id = cdad4254c9a649219fda19bf343961836183 2018-07-24 13:50:35.324 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTransportConnectingState[3]: 0x1704df000 | 07/24/13:50:35.322 | INFO | 6 | TNTransportConnectingState | Leaving state: Transport connecting 2018-07-24 13:50:35.325 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.324 | INFO | 1 | TNTwilsockClient | Change state: Transport connecting --> Initialising 2018-07-24 13:50:35.325 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNInitialisingState[3]: 0x1704df000 | 07/24/13:50:35.325 | INFO | 10 | TNInitialisingState | Entering state: Initialising 2018-07-24 13:50:35.383 ChatDemo.iOS[406:137545] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x170e2b000 | 07/24/13:50:35.382 | INFO | 1 | TNTwilsockClient | onMessageReceived, method = 8, id = cdad4254c9a649219fda19bf343961836183 2018-07-24 13:50:35.385 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[2]: 0x1704df000 | 07/24/13:50:35.384 | WARNING | 1 | TNTwilsockClient | Reply status for init request is not success: 401, AUTHENTICATION_FAILED 2018-07-24 13:50:35.386 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.385 | INFO | 1 | TNTwilsockClient | ReceivedErrorInitReply >> Initialising 2018-07-24 13:50:35.409 ChatDemo.iOS[406:137545] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x170e2b000 | 07/24/13:50:35.408 | INFO | 1 | TNTwilsockClient | onMessageReceived, method = 3, id = TM80de95a9f61045feab7e5e6ea4304165 2018-07-24 13:50:35.410 ChatDemo.iOS[406:137545] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClientImpl[3]: 0x170e2b000 | 07/24/13:50:35.409 | INFO | 3 | TNTwilsockClientImpl | Server has just initiated process of closing connection! 401: AUTHENTICATION_FAILED 2018-07-24 13:50:35.419 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNInitialisingState[3]: 0x1704df000 | 07/24/13:50:35.418 | INFO | 10 | TNInitialisingState | Leaving state: Initialising 2018-07-24 13:50:35.419 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.419 | INFO | 1 | TNTwilsockClient | Change state: Initialising --> TransportDisconnecting 2018-07-24 13:50:35.420 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTransportDisconnectingState[3]: 0x1704df000 | 07/24/13:50:35.420 | INFO | 11 | TNTransportDisconnectingState | Entering state: TransportDisconnecting 2018-07-24 13:50:35.421 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.420 | INFO | 1 | TNTwilsockClient | stopUpstreamRequests 2018-07-24 13:50:35.422 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.422 | INFO | 1 | TNTwilsockClient | sendSuccessReplyImpl >> TransportDisconnecting 2018-07-24 13:50:35.422 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTransportDisconnectingState[2]: 0x1704df000 | 07/24/13:50:35.422 | WARNING | 11 | TNTransportDisconnectingState | Success reply can not be sent. Twilsock is not in connected state 2018-07-24 13:50:35.423 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.422 | INFO | 1 | TNTwilsockClient | closeRemotelyImpl >> TransportDisconnecting 2018-07-24 13:50:35.424 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTransportDisconnectingState[2]: 0x1704df000 | 07/24/13:50:35.423 | WARNING | 11 | TNTransportDisconnectingState | Disconnect procedure has been already started 2018-07-24 13:50:35.424 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.424 | INFO | 1 | TNTwilsockClient | onDisconnectedImpl >> TransportDisconnecting 2018-07-24 13:50:35.425 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTransportDisconnectingState[3]: 0x1704df000 | 07/24/13:50:35.425 | INFO | 11 | TNTransportDisconnectingState | Leaving state: TransportDisconnecting 2018-07-24 13:50:35.425 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.425 | INFO | 1 | TNTwilsockClient | Change state: TransportDisconnecting --> Disconnected 2018-07-24 13:50:35.426 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNDisconnectedState[3]: 0x1704df000 | 07/24/13:50:35.426 | INFO | 2 | TNDisconnectedState | Entering state: Disconnected 2018-07-24 13:50:35.427 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNHttpTransportClient[3]: 0x1704df000 | 07/24/13:50:35.426 | INFO | 4 | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason 2018-07-24 13:50:35.427 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.427 | INFO | 1 | TNTwilsockClient | reset 2018-07-24 13:50:35.428 ChatDemo.iOS[406:137528] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNTwilsockClient[3]: 0x1704df000 | 07/24/13:50:35.428 | INFO | 1 | TNTwilsockClient | stopUpstreamRequests 2018-07-24 13:50:40.161 ChatDemo.iOS[406:137530] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TCHttpObserver[2]: 0x1705f7000 | 07/24/13:50:40.161 | WARNING | 9 | TCHttpObserver | Request has failed: Transport connection closed (3) 2018-07-24 13:50:40.175 ChatDemo.iOS[406:137533] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNHttpTransportClient[3]: 0x17079b000 | 07/24/13:50:40.174 | INFO | 4 | TNHttpTransportClient | requestId=RQa19b24ec7dfe480e96dd56ccda9d81e0, enqueueing request to: https://ems.us1.twilio.com/v1/token Thread finished: #8 2018-07-24 13:50:45.181 ChatDemo.iOS[406:137534] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TCHttpObserver[2]: 0x170827000 | 07/24/13:50:45.181 | WARNING | 12 | TCHttpObserver | Request has failed: Transport connection closed (3) 2018-07-24 13:50:45.198 ChatDemo.iOS[406:137534] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TNHttpTransportClient[3]: 0x170827000 | 07/24/13:50:45.198 | INFO | 4 | TNHttpTransportClient | requestId=RQ7b757b2438f44148a75b02d85d0fee08, enqueueing request to: https://ems.us1.twilio.com/v1/token 2018-07-24 13:50:50.202 ChatDemo.iOS[406:137537] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TCHttpObserver[2]: 0x1709cb000 | 07/24/13:50:50.201 | WARNING | 13 | TCHttpObserver | Request has failed: Transport connection closed (3) 2018-07-24 13:50:50.204 ChatDemo.iOS[406:137537] <<<<TwilioChatClient: 0x10c3bb5d0>>>> TCBackoffEmsClient[3]: 0x1709cb000 | 07/24/13:50:50.203 | INFO | 7 | TCBackoffEmsClient | backoff result: 2 - 'Time is exceeded', setToken result: 3 2018-07-24 13:50:50.205 ChatDemo.iOS[406:137153] <<<<TwilioChatClient: 0x10c3bb5d0>>>> Chat-iOS[0]: 0x16ed3f000 | 07/24/13:50:50.205 | FATAL | Chat-iOS | Error validating token: 3 2018-07-24 13:50:50.218 ChatDemo.iOS[406:137080] [2018-07-24 13:50:50.217] [INFO] [ChatClient: <TwilioChatClient: 0x10c3bb5d0>] Error: Error validating token., userInfo: Error validating token. code: 102, domain: signal.sdk.domain.error 2018-07-24 13:50:50.474 ChatDemo.iOS[406:137080] [2018-07-24 13:50:50.474] [ERROR] [TwilioChatHelper] Can't create client: Error Domain=signal.sdk.domain.error Code=102 "Error validating token." UserInfo={kTCHErrorMsgKey=Error validating token., NSLocalizedDescription=Error validating token.}

berkus commented 6 years ago

Token itself is fine to post if it is already expired. It usually doesn't contain anything secret.

ghost commented 6 years ago

ok.

2018-07-25 15:34:55.798 ChatDemo.iOS[335:66901] [2018-07-25 15:34:55.798] [INFO] [TokenProvider] Got chat token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6InR3aWxpby1mcGE7dj0xIn0.eyJqdGkiOiJTS2EzM2I0ZjA1N2U1MTYzNjZmODUwMTUzODljMjhhMjM3LTE1MzI1NDcyOTUiLCJncmFudHMiOnsiaWRlbnRpdHkiOiJWZWx2YSIsImNoYXQiOnsic2VydmljZV9zaWQiOiJJUzU0Njc5NmQ0ZDI2ZDRjOGJhMjE0ZmQwNzU2YjYyYzA0IiwicHVzaF9jcmVkZW50aWFsX3NpZCI6IkNSMmIwZTkzYjNjYzI1MTVkMGY5MDNmNWQ3ZDEzNjliYWQifX0sImlhdCI6MTUzMjU0NzI5NSwiZXhwIjoxNTMyNTUwODk1LCJpc3MiOiJTS2EzM2I0ZjA1N2U1MTYzNjZmODUwMTUzODljMjhhMjM3Iiwic3ViIjoiQUMwYmViMDg1ZDU4YmNmZWE1MDA5NTM2MDE4ZGEzNzkyMyJ9.PnBoA5lIBte_1ATDCgiGV5G1Q549c7o6tsMq9PGwkfk 2018-07-25 15:34:55.955 ChatDemo.iOS[335:66971] <<<<TwilioChatClient: 0x10cf10110>>>> IoService[3]: 0x16f8cf000 | 07/25/15:34:55.955 | INFO | IoService | Creating 16 threads in the executor pool 2018-07-25 15:34:55.959 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:55.959 | INFO | 1 | TNTwilsockClient | connectImpl >> Disconnected 2018-07-25 15:34:55.959 ChatDemo.iOS[335:66971] <<<<TwilioChatClient: 0x10cf10110>>>> TNHttpTransportClient[3]: 0x16f8cf000 | 07/25/15:34:55.959 | INFO | 4 | TNHttpTransportClient | initialising... 2018-07-25 15:34:55.960 ChatDemo.iOS[335:66971] <<<<TwilioChatClient: 0x10cf10110>>>> TNHttpTransportClient[3]: 0x16f8cf000 | 07/25/15:34:55.959 | INFO | 4 | TNHttpTransportClient | initialised 2018-07-25 15:34:55.961 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNDisconnectedState[3]: 0x16f1b3000 | 07/25/15:34:55.961 | INFO | 2 | TNDisconnectedState | Leaving state: Disconnected 2018-07-25 15:34:55.961 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:55.961 | INFO | 1 | TNTwilsockClient | Change state: Disconnected --> Transport connecting 2018-07-25 15:34:55.961 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTransportConnectingState[3]: 0x16f1b3000 | 07/25/15:34:55.961 | INFO | 6 | TNTransportConnectingState | Entering state: Transport connecting 2018-07-25 15:34:55.963 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:55.963 | INFO | 1 | TNTwilsockClient | addObserverImpl >> Transport connecting 2018-07-25 15:34:55.963 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNHttpTransportClient[3]: 0x16f1b3000 | 07/25/15:34:55.963 | INFO | 4 | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason 2018-07-25 15:34:55.972 ChatDemo.iOS[335:66971] <<<<TwilioChatClient: 0x10cf10110>>>> TCBackoffEmsClient[3]: 0x16f8cf000 | 07/25/15:34:55.971 | INFO | 7 | TCBackoffEmsClient | schedule new task 2018-07-25 15:34:55.979 ChatDemo.iOS[335:67059] <<<<TwilioChatClient: 0x10cf10110>>>> TNHttpTransportClient[3]: 0x1708c7000 | 07/25/15:34:55.979 | INFO | 4 | TNHttpTransportClient | requestId=RQ88ab36314ed64ae292c59915ce3101eb, enqueueing request to: https://ems.us1.twilio.com/v1/token 2018-07-25 15:34:56.439 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.438 | INFO | 1 | TNTwilsockClient | onTransportConnectedImpl >> Transport connecting 2018-07-25 15:34:56.447 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClientImpl[3]: 0x16f1b3000 | 07/25/15:34:56.447 | INFO | 3 | TNTwilsockClientImpl | sendInit, id = fda5d4e934ef471cbc7fd9ae28c0bb2abb2a 2018-07-25 15:34:56.476 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTransportConnectingState[3]: 0x16f1b3000 | 07/25/15:34:56.475 | INFO | 6 | TNTransportConnectingState | Leaving state: Transport connecting 2018-07-25 15:34:56.477 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.476 | INFO | 1 | TNTwilsockClient | Change state: Transport connecting --> Initialising 2018-07-25 15:34:56.477 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNInitialisingState[3]: 0x16f1b3000 | 07/25/15:34:56.477 | INFO | 10 | TNInitialisingState | Entering state: Initialising 2018-07-25 15:34:56.620 ChatDemo.iOS[335:67075] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x171187000 | 07/25/15:34:56.619 | INFO | 1 | TNTwilsockClient | onMessageReceived, method = 8, id = fda5d4e934ef471cbc7fd9ae28c0bb2abb2a 2018-07-25 15:34:56.621 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[2]: 0x16f1b3000 | 07/25/15:34:56.620 | WARNING | 1 | TNTwilsockClient | Reply status for init request is not success: 401, AUTHENTICATION_FAILED 2018-07-25 15:34:56.621 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.621 | INFO | 1 | TNTwilsockClient | ReceivedErrorInitReply >> Initialising 2018-07-25 15:34:56.683 ChatDemo.iOS[335:67075] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x171187000 | 07/25/15:34:56.682 | INFO | 1 | TNTwilsockClient | onMessageReceived, method = 3, id = TM180b7ffb82d748a1a5a705bbe3cd288e 2018-07-25 15:34:56.683 ChatDemo.iOS[335:67075] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClientImpl[3]: 0x171187000 | 07/25/15:34:56.683 | INFO | 3 | TNTwilsockClientImpl | Server has just initiated process of closing connection! 401: AUTHENTICATION_FAILED 2018-07-25 15:34:56.686 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNInitialisingState[3]: 0x16f1b3000 | 07/25/15:34:56.686 | INFO | 10 | TNInitialisingState | Leaving state: Initialising 2018-07-25 15:34:56.686 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.686 | INFO | 1 | TNTwilsockClient | Change state: Initialising --> TransportDisconnecting 2018-07-25 15:34:56.687 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTransportDisconnectingState[3]: 0x16f1b3000 | 07/25/15:34:56.687 | INFO | 11 | TNTransportDisconnectingState | Entering state: TransportDisconnecting 2018-07-25 15:34:56.687 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.687 | INFO | 1 | TNTwilsockClient | stopUpstreamRequests 2018-07-25 15:34:56.689 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.688 | INFO | 1 | TNTwilsockClient | sendSuccessReplyImpl >> TransportDisconnecting 2018-07-25 15:34:56.689 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTransportDisconnectingState[2]: 0x16f1b3000 | 07/25/15:34:56.689 | WARNING | 11 | TNTransportDisconnectingState | Success reply can not be sent. Twilsock is not in connected state 2018-07-25 15:34:56.689 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.689 | INFO | 1 | TNTwilsockClient | closeRemotelyImpl >> TransportDisconnecting 2018-07-25 15:34:56.690 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTransportDisconnectingState[2]: 0x16f1b3000 | 07/25/15:34:56.689 | WARNING | 11 | TNTransportDisconnectingState | Disconnect procedure has been already started 2018-07-25 15:34:56.690 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.690 | INFO | 1 | TNTwilsockClient | onDisconnectedImpl >> TransportDisconnecting 2018-07-25 15:34:56.691 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTransportDisconnectingState[3]: 0x16f1b3000 | 07/25/15:34:56.690 | INFO | 11 | TNTransportDisconnectingState | Leaving state: TransportDisconnecting 2018-07-25 15:34:56.691 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.691 | INFO | 1 | TNTwilsockClient | Change state: TransportDisconnecting --> Disconnected 2018-07-25 15:34:56.692 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNDisconnectedState[3]: 0x16f1b3000 | 07/25/15:34:56.691 | INFO | 2 | TNDisconnectedState | Entering state: Disconnected 2018-07-25 15:34:56.692 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNHttpTransportClient[3]: 0x16f1b3000 | 07/25/15:34:56.692 | INFO | 4 | TNHttpTransportClient | twilsock is in disconnected state: Unknown reason 2018-07-25 15:34:56.693 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.692 | INFO | 1 | TNTwilsockClient | reset 2018-07-25 15:34:56.694 ChatDemo.iOS[335:67058] <<<<TwilioChatClient: 0x10cf10110>>>> TNTwilsockClient[3]: 0x16f1b3000 | 07/25/15:34:56.694 | INFO | 1 | TNTwilsockClient | stopUpstreamRequests 2018-07-25 15:35:00.984 ChatDemo.iOS[335:67060] <<<<TwilioChatClient: 0x10cf10110>>>> TCHttpObserver[2]: 0x170953000 | 07/25/15:35:00.984 | WARNING | 9 | TCHttpObserver | Request has failed: Transport connection closed (3) 2018-07-25 15:35:00.998 ChatDemo.iOS[335:67063] <<<<TwilioChatClient: 0x10cf10110>>>> TNHttpTransportClient[3]: 0x170af7000 | 07/25/15:35:00.998 | INFO | 4 | TNHttpTransportClient | requestId=RQd5a92a7cb7f94ffb951b44d0ae39532b, enqueueing request to: https://ems.us1.twilio.com/v1/token 2018-07-25 15:35:06.003 ChatDemo.iOS[335:67064] <<<<TwilioChatClient: 0x10cf10110>>>> TCHttpObserver[2]: 0x170b83000 | 07/25/15:35:06.002 | WARNING | 12 | TCHttpObserver | Request has failed: Transport connection closed (3) 2018-07-25 15:35:06.018 ChatDemo.iOS[335:67064] <<<<TwilioChatClient: 0x10cf10110>>>> TNHttpTransportClient[3]: 0x170b83000 | 07/25/15:35:06.018 | INFO | 4 | TNHttpTransportClient | requestId=RQ5f3904df490843d1997838e8bd7cf85d, enqueueing request to: https://ems.us1.twilio.com/v1/token 2018-07-25 15:35:11.024 ChatDemo.iOS[335:67068] <<<<TwilioChatClient: 0x10cf10110>>>> TCHttpObserver[2]: 0x170db3000 | 07/25/15:35:11.023 | WARNING | 13 | TCHttpObserver | Request has failed: Transport connection closed (3) 2018-07-25 15:35:11.025 ChatDemo.iOS[335:67068] <<<<TwilioChatClient: 0x10cf10110>>>> TCBackoffEmsClient[3]: 0x170db3000 | 07/25/15:35:11.024 | INFO | 7 | TCBackoffEmsClient | backoff result: 2 - 'Time is exceeded', setToken result: 3 2018-07-25 15:35:11.026 ChatDemo.iOS[335:66971] <<<<TwilioChatClient: 0x10cf10110>>>> Chat-iOS[0]: 0x16f8cf000 | 07/25/15:35:11.025 | FATAL | Chat-iOS | Error validating token: 3 2018-07-25 15:35:11.036 ChatDemo.iOS[335:66901] [2018-07-25 15:35:11.036] [INFO] [ChatClient: <TwilioChatClient: 0x10cf10110>] Error: Error validating token., userInfo: Error validating token. code: 102, domain: signal.sdk.domain.error 2018-07-25 15:35:11.188 ChatDemo.iOS[335:66901] [2018-07-25 15:35:11.188] [ERROR] [TwilioChatHelper] Can't create client: Error Domain=signal.sdk.domain.error Code=102 "Error validating token." UserInfo={kTCHErrorMsgKey=Error validating token., NSLocalizedDescription=Error validating token.}

aleksandrsivanovs commented 5 years ago

we have just release new version 0.4.0 at https://www.nuget.org/packages/Twilio.Chat.Xamarin/ please try with the new version

aleksandrsivanovs commented 5 years ago

ok, seems that there is no answer, which, I assume means that the problem is fixed :)