Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

However, scanning and connecting to Wi-Fi IoT devices still requires it.


No it doesn't, there's a whole API for last few years where app can connect to its own IoT device without getting location or full scanning grant.


Why do you think that? I literally just wrote an app to do this. From my notes:

> Android 13 still requires `ACCESS_FINE_LOCATION` to call `startScan()` and `getScanResults()` - `NEARBY_WIFI_DEVICES` is not sufficient

See here: https://developer.android.com/reference/android/net/wifi/Wif...()

I tried getting by without it, but it was required.


The APIs to connect to IoT devices is called CompanionDeviceManager - https://developer.android.com/guide/topics/connectivity/comp...


Wow, thanks for that. I will have to try this. It is annoying that it is hidden under the Bluetooth breadcrumbs.


Yeah, the WiFi part seems a bit like an afterthought.


That poster I assume is referring to this for your own devices. https://developer.android.com/guide/topics/connectivity/comp....

Depends on the specific use case but you ideally shouldn't need those calls. Our app request both the old location permission and the new nearby permission just because not all of our vendors keep their libraries up to date and its not unreasonable for the app to know where you are when using those features.


Thank you! I will give this a try.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: