-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: react to network availability #20
Conversation
@@ -1,4 +1,5 @@ | |||
<?xml version="1.0" encoding="utf-8"?> | |||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | |||
<uses-permission android:name="android.permission.INTERNET" /> | |||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this is something we need to declare here or if we have to ask users to provide this permission (in other words, can we make this permission optional?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand correctly, libraries should declare what they want/need as well. So we should have this here
@@ -101,8 +103,10 @@ class DefaultUnleash( | |||
) | |||
) | |||
} | |||
}.toImmutableList() | |||
}.toImmutableList(), | |||
networkAvailable = networkStatusHelper.isAvailable() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initial value
67369e1
to
43da832
Compare
Add a listener to network changes. The implementation adapts to different API levels. If above 23 it uses the new mechanism and otherwise it falls back to the previous mechanism