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

feat: react to network availability #20

Merged
merged 5 commits into from
Jul 16, 2024
Merged

Conversation

gastonfournier
Copy link
Contributor

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

@gastonfournier gastonfournier requested a review from chriswk July 15, 2024 13:55
@gastonfournier gastonfournier self-assigned this Jul 15, 2024
@@ -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" />
Copy link
Contributor Author

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?)

Copy link
Member

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()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial value

@gastonfournier gastonfournier force-pushed the react-to-network-changes branch from 67369e1 to 43da832 Compare July 15, 2024 16:27
@gastonfournier gastonfournier merged commit 9ddcb19 into main Jul 16, 2024
1 check passed
@gastonfournier gastonfournier deleted the react-to-network-changes branch July 16, 2024 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants