Scarlet icon indicating copy to clipboard operation
Scarlet copied to clipboard

First start websocket

Open covenant3717 opened this issue 4 years ago • 6 comments

At the first launch of the application - the socket connection does not start working until you exit the application and enter again. The demo in the repository works the same way.

covenant3717 avatar Nov 09 '20 06:11 covenant3717

I'm also having this issue.

MarianVasilca avatar Nov 10 '20 17:11 MarianVasilca

Noticed the same problem. 0.1.10 doesn't have this issue.

nostra13 avatar Dec 04 '20 16:12 nostra13

Problem isn't occurring on every device. I've got Google Pixel 5 with Android 11 and everything works fine. But on some devices (and on emulators) this issue happens every time. It has something to do with lifecycle handling - hiding the app to the background and coming back initializes the websockets.

gabrysgab avatar Jun 02 '21 07:06 gabrysgab

Any update on this issue ?

AmmeySaini avatar Sep 03 '21 06:09 AmmeySaini

@aaronweihe any updates? please..

AmmeySaini avatar Sep 03 '21 07:09 AmmeySaini

Figured it out, If you are using fragments then simply use .lifecycle(AndroidLifecycle.ofLifecycleOwnerForeground(app, owner)) in Builder where owner = viewLifecycleOwner

AmmeySaini avatar Sep 03 '21 08:09 AmmeySaini