Closed TinhHuynh closed 4 weeks ago
Hey @TinhHuynh, thanks for reaching out.
StreamVideo.reset(disconnect: true)
would do most of what you are asking for. But we were indeed missing a proper dispose method that would also dispose PushNotificationManager
. Added it here
Hi @Brazol
StreamVideo.reset(disconnect: true)
will unregister the user's push token by calling pushNotificationManager?.unregisterDevice();
in _disconnect()
.
Since that, the user cannot receive further push notifications from FCM.
You are of course right, dispose
makes even more sense now
Thanks for your support, the PR looks good!
Hi @Brazol May I know when the PR will be merged and released in the next version? This is crucial for us.
Closed with https://github.com/GetStream/stream-video-flutter/pull/648, Release in v0.3.7
Hi,
We create a StreamVideo client in a background isolate and let it handle
RemoteMessage
from FCM then callStreamVideo.reset()
. However,StreamVideo.reset()
resets the singleton instance to null without clearing any resource: WebSocket connection, pushNotificationManager..... This will lead to the case that the associating WebSocket is still alive, and the user will have multiple connections simultaneously.Do these connections count toward the Maximum Concurrent Connection limit in our plan? If so, could you provide any guidance to close the WebSocket connection before resetting the singleton client?
StreamChatClient has the method
dispose()
which I am using to dispose of the chat client when it finishes handling FCM messages, it would be helpful if StreamVideo had such a method.Thank you in advance!