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

WifiManager.startScan() was deprecated in API level 28 #99

Open
t-ricci-enhancers opened this issue Nov 5, 2019 · 3 comments
Open

WifiManager.startScan() was deprecated in API level 28 #99

t-ricci-enhancers opened this issue Nov 5, 2019 · 3 comments

Comments

@t-ricci-enhancers
Copy link

t-ricci-enhancers commented Nov 5, 2019

The documentation of the Android SDK states that:

This method was deprecated in API level 28.
The ability for apps to trigger scan requests will be removed in a future release.

Do you know if there will be an alternative API for the same purpose?
Also will the plugin prevent crashes if in a future Android release if an app using the plugin will try to scan for networks?

https://developer.android.com/reference/android/net/wifi/WifiManager.html#startScan()

@bareynol
Copy link

bareynol commented Feb 20, 2020

I'm on Android API level 29, and running reScanAndLoadWifiList, which uses WifiManager.startScan() does not run the callback function provided (nor does it run the error handler provided).

This is a breaking issue for me, since loadWifiList always returns an empty array.

I can verify that the app does have the required permissions enabled, wifi is turned on, and going to the phone's Wifi settings, there are networks listed.

EDIT: Nevermind. The reason for this was that location services were not enabled.

@tranvanhien187
Copy link

Tôi đang ở cấp API Android 29 và đang chạy reScanAndLoadWifiList, sử dụng WifiManager.startScan()không chạy hàm gọi lại được cung cấp (cũng như không chạy trình xử lý lỗi được cung cấp).

Đây là một vấn đề khó khăn đối với tôi, vì loadWifiListluôn trả về một mảng trống.

Tôi có thể xác minh rằng ứng dụng đã bật các quyền cần thiết, Wi-Fi đã được bật và đi tới cài đặt Wifi của điện thoại, có các mạng được liệt kê.

CHỈNH SỬA: Đừng bận tâm. Lý do cho điều này là các dịch vụ vị trí không được kích hoạt.

Can you tell me how do you solve this problem ?

@t-ricci-enhancers
Copy link
Author

Personally I switched to: https://github.com/JuanSeBestia/react-native-wifi-reborn

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

No branches or pull requests

3 participants