在不征求用户许可的情况下打开Android LE扫描 [英] Turn on Android LE scanning without asking user for permission

查看:69
本文介绍了在不征求用户许可的情况下打开Android LE扫描的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一些调查和分析表明,用户经常拒绝出现在移动应用中的位置许可"请求,即使该许可对于该应用是至关重要的,例如该应用程序对场所中处理业务逻辑并与移动应用程序交换数据的设备执行自动扫描.许可请求的拒绝率如此之高,以至于业务出现问题.Android中有什么方法可以避免这种情况,例如声明一些无需许可即可扫描的经过验证的设备?我想到了 https://developer.android.com/guide/topics/connectivity/companion-device-pairing ,但这也意味着弹出用户手动操作的请求.今天有什么办法在幕后吗?

Some surveys and analytics showed that users very often turn down Location Permission request appearing in the mobile app even if this permission is crucial for the app, e.g. the app performs automatic scan for devices in a venue that handle business logic and exchange data with the mobile app. The permission request turn down rate is so high that it becomes problematic for business. Is there any way in Android to avoid this, e.g. to declare some verified devices that can be scanned without permission request? I thought of https://developer.android.com/guide/topics/connectivity/companion-device-pairing but it also means popping up requests for manual work for the user. Is there any way today to do it behind the scenes?

推荐答案

不幸的是,出于隐私和安全原因,这是不可能的.在Android设备上启用BLE与位置许可密切相关.如果您使用经典蓝牙而不是BLE,则唯一可能的解决方法是.我对此不是100%肯定,但是

Unfortunately this is not possible for privacy and security reasons. Enabling BLE on Android devices goes hand in hand with the location permission. The only possible workaround for this is potentially if you use classic Bluetooth instead of BLE. I am not 100% sure about this one, but it is mentioned in this article:-

没有位置权限,没有人可以使用BLE扫描API,并且,在大多数设备上,没有活动的位置服务就没有用.但是,低功耗蓝牙是所谓蓝牙的扩展经典且有趣的是Google决定不需要此API位置权限被调用.

No one can use BLE scan API without having Location Permissions, and, on most devices, it is useless without active Location Services. However, Bluetooth Low Energy is an extension to so-called Bluetooth Classic and interestingly enough Google decided this API does not need location permissions to be called.

这是无法克服的操作系统要求.您可能已经在 BLE的Android开发人员页面上看到了:-

This is an OS requirement which cannot be overcome. You might've already seen this on the Android developer page for BLE:-

为了在您的应用程序中使用蓝牙功能,您必须声明两个权限.首先是蓝牙.你需要执行任何蓝牙通信的权限,例如请求连接,接受连接并转移数据.

In order to use Bluetooth features in your application, you must declare two permissions. The first of these is BLUETOOTH. You need this permission to perform any Bluetooth communication, such as requesting a connection, accepting a connection, and transferring data.

您必须声明的另一个权限是ACCESS_FINE_LOCATION.您的应用需要此权限,因为可以使用蓝牙扫描来收集有关用户位置的信息.此信息可能来自用户自己的设备以及蓝牙信标在商店和运输设施等地方使用.

The other permission that you must declare is ACCESS_FINE_LOCATION. Your app needs this permission because a Bluetooth scan can be used to gather information about the location of the user. This information may come from the user's own devices, as well as Bluetooth beacons in use at locations such as shops and transit facilities.

您可以在此处找到有关此的更多信息:-

You can find more info about this here:-

这篇关于在不征求用户许可的情况下打开Android LE扫描的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆