-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disconnect on Cordova Pause and Reconnect on Cordova Resume #3808
Conversation
Does push notification still work after that? |
@marceloschmidt After disabling the mobile background data usage for the rocket.chat app on Android the mobile push notifications work like before. (Because the push notifications come from a system service..) |
My only concern is about this. I think we should call |
@graywolf336 did you test this? Solved the battery problem? |
@sampaiodiego I agree, I didn't see that last night when I looked for existing ones. I will move it to there. @rodrigok Not yet, I created this pull request so I could make usage of the heroku deployment. |
@graywolf336 you forgot to change the |
That's what I get for trying to do it fast before I left for work. 👎 |
We should set a timer, for 5 minutes, before disconnecting. If the user is just going to another app to get some info, he can come back quickly. The 5 minutes can be a user's config. |
@engelgabriel maybe 1 minute? |
@engelgabriel I agree with @rodrigok, one minute is probably good enough by default to increase the battery saving this hopefully will enable. |
Agreed, 1 minute should be fine. Can you do that @graywolf336? |
Yes I will take a look at adding that this week. |
@RocketChat/core Thoughts on this now? |
Should we add a issue to turn the time into a setting @graywolf336 ? |
Nice! Thanks for your amazing work. @graywolf336 @engelgabriel |
@engelgabriel Yeah we could, probably should be a personally setting though. |
Thanks for keeping the world green , @graywolf336 ! |
I like @graywolf336 's idea, this should be an admin setting. |
@RocketChat/core
Closes: RocketChat/Rocket.Chat.Cordova#112
This basically listens for Cordova's
pause
event and disconnects from the server thus saving background battery usage. Then when Cordova firesresume
event we reconnect to the server. This will cause a little bit of delay, but I feel that delay is worth the extra battery life saved.