ConnectyCube / connectycube-flutter-samples

Code samples for Flutter, based on ConnectyCube platform
https://developers.connectycube.com/flutter/
Apache License 2.0
85 stars 90 forks source link

for online status i have added this code. but if i want status for all the users in my list there is not easy way, can u add method for the same in sdk ? #290

Open richanshah opened 1 year ago

richanshah commented 1 year ago

for isOnline status, i have added this code. but if i want status for all the users in my list there is not easy way, can u add method for the same in sdk ?
CubeChatConnection.instance.lastActivityManager ?.subscribeToUserLastActivityStatus(cubeUser.id!, callback: (seconds) { log("lastActivity: userId = ${cubeUser.id}, seconds = ${seconds}"); });

TatankaConCube commented 1 year ago

unfortunately, we don't have other alternatives for now. initially, the subscribeToUserLastActivityStatus listener was developed to display user status in opened private chat, and in other places (dialogs list, contacts list, etc.) planned to use the Future<int> getLastActivity(int userId) method.

richanshah commented 1 year ago

even after listening to this subscribeToUserLastActivityStatus , i am not getting this status continuously. have u keep any interval when it will get updated?

TatankaConCube commented 1 year ago

do you mean that you don't receive events in the callback?

richanshah commented 1 year ago

I am getting online status when another user logins but whby hen i pause the app or destory the session i am not getting offline status or any callbacks by which i can identify

richanshah commented 1 year ago

it stills give me last online status data only

richanshah commented 1 year ago

on the base of what u r giving last activity call back?

TatankaConCube commented 1 year ago

pause the app or destory the session

this callback should work on the user's chat login/logout action. when the user you subscribed to makes the chat login/logout action the subscribed user should receive these events

on the base of what u r giving last activity call back?

when the user makes the chat login/logout actions our chat server sends the special stanzas for subscribed users

TatankaConCube commented 1 year ago

I requested from the back-end team the modification for this feature for subscription on multiple users and triggering the active/inactive user's events too, but they don't have the end date of the implementation of it.

richanshah commented 1 year ago

pause the app or destory the session

this callback should work on the user's chat login/logout action. when the user you subscribed to makes the chat login/logout action the subscribed user should receive these events

on the base of what u r giving last activity call back?

when the user makes the chat login/logout actions our chat server sends the special stanzas for subscribed users

okay

richanshah commented 1 year ago

I requested from the back-end team the modification for this feature for subscription on multiple users and triggering the active/inactive user's events too, but they don't have the end date of the implementation of it.

no problem, please update me once its done.

TatankaConCube commented 1 year ago

please update me once its done.

ok, sure