0

Working on a Swift chat application. On one device, I join a channel with unique name "private:chat", and then I call channel.typing() on the channel (as is mention in docs). On another device, I again create a client with a delegate set to self:

TwilioChatClient.chatClient(withToken: token, properties: nil, delegate: self) { (result, chatClient) in
    self.client = chatClient
}

And then I implemented typingStartedOn delegate method to listen to typing on the channel.

func chatClient(_ client: TwilioChatClient, typingStartedOn channel: TCHChannel, member: TCHMember) {
    print(">>>>>>>>>>>>> typing on \(channel.uniqueName) by \(member.identity)")
}

However, the delegate method does not get called, even though I confirmed that the channel.typing() gets called by the other account on the other device. The docs inline code in JS, but based on iOS chat demo app I came to conclusion that in Swift the delegate methods are the way to go.

Any idea what might be going on here?

EDIT: Some (haven't tested all) of the other delegate methods, such as synchronizationStatusUpdated, are getting called.

Milan Nosáľ
  • 19,169
  • 4
  • 55
  • 90

1 Answers1

0

So after all, the issue was not in the iOS client, but in our implementation of the access token server.

As @rbeiter noted in his comment on GitHub issue, Twilio does not send typing indicator if the user identity is the same on both devices. I was setting the identity properly on both devices to keep it different, but our access token server ignored the identity parameter and used a hardcoded value. Thus from Twilio viewpoint, the same user was on both devices. Fixing the access token server fixed the problem.

Milan Nosáľ
  • 19,169
  • 4
  • 55
  • 90