[Amity Chat SDK] My subscribe callback on getMessages(Channel_ID) is not called each time I get new messages in chat room

Yes Marti.
Overall looks alright except the AmityCoreClient.INSTANCE.unregisterDevice();

It’s not necessary to call when an activity is destroyed. The function meant to logout the current user from the system. You could keep the user until they really need to logout from the system.

ok, thanks @Trust .
So now, thanks to the throttleLatest() my subscribe callback isn’ called 4-5 times after I receive only one message, it is called two times.
But still something is wrong here, sometimes my subscribe callback stops being called. None of the doOn…() methods are called, like there is no error

That’s odd, may you add doOnTerminate { } to observe the behaviour as well?

I tested it now again. It is working. I was sending in a loop 10 messages and sleep one second.
I hope it stays this way when I add translating again. :smile: Thanks for the help @Trust

Awesome, happy to help @marti