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

Doesn't notify when connection is restored after restarting the router #357

Open
AhmedMourad0 opened this issue Jul 22, 2019 · 2 comments
Open

Comments

@AhmedMourad0
Copy link

AhmedMourad0 commented Jul 22, 2019

Describe the bug
When i restart the router, i get notified that connection is lost but i never get notified when it's restored.

To Reproduce
Steps to reproduce the behavior:

The code:

ReactiveNetwork.observeNetworkConnectivity(applicationContext)
    .flatMap { network ->
        ReactiveNetwork.checkInternetConnectivity()
            .toObservable()
            .map { network.state() to it }
    }.map {

        val (networkState, isInternetAvailable) = it

        return when {
            isInternetAvailable -> // connected
            networkState == NetworkInfo.State.CONNECTING -> // connecting
            networkState == NetworkInfo.State.DISCONNECTED -> // disconnected
            else -> // disconnected
        }
    }.subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe({  /* ... */  }, { it.printStackTrace() })
  1. run the app (using WIFI, haven't tested it with data)
  2. restart the router (the app never gets notified when connection is restored)

Smartphone (please complete the following information):

  • Device: Huawei Y7 Prime 2018
  • OS: Android 8
  • Library Version: 3.0.3
@pwittchen
Copy link
Owner

pwittchen commented Jul 22, 2019 via email

@AhmedMourad0
Copy link
Author

AhmedMourad0 commented Jul 22, 2019

That'd be great, thank you!

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

No branches or pull requests

2 participants