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

BREAKING CHANGE: Use WifiUtils to connect with a wifi network #46

Merged
merged 3 commits into from
Mar 17, 2020
Merged

BREAKING CHANGE: Use WifiUtils to connect with a wifi network #46

merged 3 commits into from
Mar 17, 2020

Conversation

eliaslecomte
Copy link
Collaborator

Starting Android 10, it's no longer possible to connect (as an app) to wifi networks like before.

What can an app still do:

Temporary connect to a wifi access point (for example to setup an IoT device)
Suggest a network, but the OS can choose what to do with it.
With this PR, i've switched the connection logic to use WifiUtils which just released support for option 1.

Advantages of using WifiUtils:

Works well on different android versions
Only resolves when the app is connected to the network
Has a good retry mechanism built in
Well written code

Elias Lecomte added 3 commits March 4, 2020 15:51
…m/ThanosFisherman/WifiUtils/releases/tag/WifiUtils1.5.0) to support Android Q as the current implementation does not work on all android 10 devices. This library also contains several bugs for device-specific issues and only resolves 💖 when the wifi network is actually connected!
…h-semantics

# Conflicts:
#	README.md
#	android/src/main/java/com/reactlibrary/rnwifi/RNWifiModule.java
@eliaslecomte
Copy link
Collaborator Author

eliaslecomte commented Mar 4, 2020

It is true that the android 10 support from WifiUtils is still early. We have tested this on multiple android devices and when we can improve, we will contribute to WifiUtils and react-native-wifi-reborn.
But doing nothing is no option, even when you target Android 9, some android 10 devices will block wifi connection attempts with the previous code resulting in a nonfunctioning app.

@Rapsssito
Copy link
Collaborator

As mentioned here (#28 (comment)), right now, you can connect to open WiFi networks passing null as password. Could you confirm if this is still the case with this change?

@Rapsssito Rapsssito requested a review from JuanSeBestia March 4, 2020 16:38
@Rapsssito
Copy link
Collaborator

@JuanSeBestia, why would this be a BREAKING CHANGE?

@eliaslecomte
Copy link
Collaborator Author

@JuanSeBestia, why would this be a BREAKING CHANGE?

Because this is a hefty change regardign connecting on Android. For one, it uses new code for pre android 10 and starting 10 it's also completely different in it's way, that only the current app can use the wifi network.

@Rapsssito
Copy link
Collaborator

Rapsssito commented Mar 5, 2020

@eliaslecomte, for semantic-release compatibility, could you add to your initial post body something along the lines of:

BREAKING CHANGE: ...broken functionalities

following the AngularJS Git Commit Convention?

@Rapsssito
Copy link
Collaborator

@eliaslecomte, should we wait for @JuanSeBestia opinion?
LGTM. It will fix a lot of future issues and focuses our work in JavaScript and Objective-C.

@eliaslecomte
Copy link
Collaborator Author

I do think @JuanSeBestia should approve :-).

@JuanSeBestia
Copy link
Owner

  1. When you do a commit changing readme like chore: update the readme you would use the prefix docs, like docs: update the readme
  2. Really looks very clean code in android
  3. We forgot iOS :(

We want to clarify changing the versión in the readme if someone need the previous version, wich versión would need to install

In the nutshell, I will allow marge this MR :)

@JuanSeBestia JuanSeBestia merged commit eeea1af into JuanSeBestia:master Mar 17, 2020
JuanSeBestia pushed a commit that referenced this pull request Mar 17, 2020
# [3.0.0](v2.4.0...v3.0.0) (2020-03-17)

* Merge pull request #46 from inthepocket/feature/use-wifiutils-for-android-with-semantics ([eeea1af](eeea1af)), closes [#46](#46)

### BREAKING CHANGES

* Use WifiUtils to connect with a wifi network
@JuanSeBestia
Copy link
Owner

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@eliaslecomte eliaslecomte deleted the feature/use-wifiutils-for-android-with-semantics branch March 18, 2020 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

connectToProtectedSSID should update network configuration if password changed
3 participants