Skip to content
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

How to check Internet Connection in Background continuously even if App is Running or Not/Closed.. #470

Open
patelakshay13890 opened this issue Jan 31, 2023 · 1 comment
Labels

Comments

@patelakshay13890
Copy link

How Check Internet Connection in Broadcast Receiver or Service Like as we do in Activity ?
But I need in Service or Broadcast Receiver..
Means I need to check Internet Connation in Background continuously even if App is Running or Not/Closed..
As on Internet Connectivity change I want to Sync My Data to Server so please help me out..!!
Thanks..

@pwittchen
Copy link
Owner

pwittchen commented Feb 1, 2023

Hi @patelakshay13890,

This library is designed to be used while app is running and active. If the Activity is inactive (in background) then library should not detect changes and it should start detecting connectivity changes again when app is active (in foreground) again.

If you want to use library when app is inactive (in the background), then you should create an Android Service and then use it inside Service. Of course, you need to dispose appropriate subscription/disposable, when Service is being closed or destroyed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants