In Twilio Conversations, how to catch the event when the user's token is in less than 3 minutes of validity (conversationsClientTokenWillExpire)

20 views Asked by At

I have the method conversationsClientTokenWillExpire ready, but I don't know how to catch the event and trigger this method automatically. I am using Laravel as token generator, and everything else regarding backend for my chat app. I am using Swift as the client app. How do I subscribe to the event? The chat app works, and everything is fine until the first expiration occurs. Than, on the subsequent tries to initiate the chat, it doesn't work any more, because of the expired token. I want to refresh it, and I know how to create a new token on backend, and where to put it on the swift client. But I don't know how to subscribe to the near-expiration time and refresh it. Do you know?

0

There are 0 answers