crisp-sdk-ios icon indicating copy to clipboard operation
crisp-sdk-ios copied to clipboard

Chat fails to start with token id

Open xHunter opened this issue 4 years ago • 3 comments

I've seen the chat failing when it's restoring a chat from a token also session reset seems unreliable, changing user and token keeps showing the previous chat.

xHunter avatar Jul 23 '20 22:07 xHunter

Hello, could you pease elaborate? Could you send a snippet of your code for restoring with the token?

eliottvincent avatar Jul 31 '20 07:07 eliottvincent

I'm setting user details when the registered user starts a session (app)

CrispSDK.setTokenID(tokenID: user.crispTokenId)
CrispSDK.user.email = user.email
CrispSDK.user.nickname = user.name

Then later when the chat is presented self.present(Crisp.ChatViewController(), animated: true) if the token id was used in another platform (e.g. Android) the chat displays an alert that it failed to start the chat.

xHunter avatar Jul 31 '20 13:07 xHunter

I've discovered the same problem and it's still present in the latest release.

What I do:

  • Set the token ID (CrispSDK.setTokenID(tokenID: options.value(forKey: "tokenId") as! String))
  • open the chatbox

What I get:

  • Error starting chat

If I don't set the tokenID there's no problem.

Update: After some more testing I've found out that the problem only exists when the tokenID was previously used on an other device (for example in web).

gergof avatar Apr 27 '21 13:04 gergof

Hi everyone,

It’s been a while since this issue was reported, and we’ve launched a new major version of the Crisp SDK since then. The updates might have resolved the issue you encountered.

We’d appreciate it if you test the latest version to see if the issue persists. Feel free to reopen this issue with more details if needed.

Thanks for your support!

nesium avatar Aug 07 '23 09:08 nesium