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

add location permission check for getCurrentWifiSSID and reScanAndLoa… #264

Merged
merged 2 commits into from
May 26, 2023

Conversation

JohnWilliamForcier-Spiria
Copy link
Collaborator

@JohnWilliamForcier-Spiria JohnWilliamForcier-Spiria commented Aug 18, 2022

Fix : #257 , #265 , #258 and clarify #238

…dWifiList and change error message for clarity
@eliaslecomte
Copy link
Collaborator

👏 Thanks for your contribution!

@@ -576,4 +568,20 @@ private void stuffWifiConfigurationWithoutEncryption(final WifiConfiguration wif
private String formatWithBackslashes(final String value) {
return String.format("\"%s\"", value);
}

private boolean isLocationPermissionGranted(final Promise promise) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not a 100% fan of the method name, as this method does the check and rejects the promise, which isn't clear now.

Copy link
Collaborator

@eliaslecomte eliaslecomte Sep 8, 2022

Choose a reason for hiding this comment

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

maybe rejectIfLocationPermissionMissing or assertLocationPermissionGranted?

@eliaslecomte eliaslecomte added the bug Something isn't working label Sep 8, 2022
@elliottkember
Copy link
Contributor

This patch looks good @eliaslecomte – are there any concerns about merging?

@robrechtme
Copy link
Contributor

@JuanSeBestia looks good to me, can this be merged and published?

@ryanstout
Copy link

Looks like in Android 13 you can request android.permission.NEARBY_WIFI_DEVICES instead of ACCESS_FINE_LOCATION. Would it be possible to add a check for NEARBY_WIFI_DEVICES or ACCESS_FINE_LOCATION on 13? (so we could not request ACCESS_FINE_LOCATION in 13) Thanks!

@JuanSeBestia JuanSeBestia merged commit c3ba4e5 into master May 26, 2023
JuanSeBestia pushed a commit that referenced this pull request May 26, 2023
## [4.7.1](v4.7.0...v4.7.1) (2023-05-26)

### Bug Fixes

* **Android:** * add location permission check for getCurrentWifiSSID and reScanAndLoadWifiList and change error message for clarity ([#264](#264)) ([c3ba4e5](c3ba4e5))
@JuanSeBestia
Copy link
Owner

🎉 This PR is included in version 4.7.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@JuanSeBestia
Copy link
Owner

I squash and rename to

fix(Android): add location permission check for getCurrentWifiSSID and reScanAndLoadWifiList and change error message for clarity

because semantic commits is needed to release a new version

@eliaslecomte eliaslecomte deleted the bugfix/add_location_permission_check branch May 26, 2023 11:26
@eliaslecomte
Copy link
Collaborator

Thanks @JuanSeBestia for merging this & doing a release 🎉.

timok06 added a commit to enna-systems/react-native-wifi-reborn that referenced this pull request Aug 4, 2023
* master_new:
  chore(asdf): add a .tool-versions for asdf, set node to 16.18.0 and update package-lock files
  chore(release): 4.8.3 [skip ci]
  fix(iOS): add missing isHidden flag to connectToProtectedSSID (JuanSeBestia#306)
  chore(release): 4.8.2 [skip ci]
  fix: prefer not to mutate the ScanResult object (JuanSeBestia#268)
  chore(release): 4.8.1 [skip ci]
  fix: update android native dependencies
  chore(release): 4.8.0 [skip ci]
  feat(Android): added feature to connect to hidden wifi on android 10 (JuanSeBestia#287)
  chore(release): 4.7.1 [skip ci]
  fix(Android): * add location permission check for getCurrentWifiSSID and reScanAndLoadWifiList and change error message for clarity (JuanSeBestia#264)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

couldNotDetectSSID :Cannot get current SSID!
6 participants