1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/zhongte-TaoYao

 / Детали:

Проблемы с комбинированной позиционировкой

Предстоит сделать
Владелец
Создано  
15.03.2025
private permissions: Array<Permissions> = [
  // "ohos.permission.USE_BLUETOOTH",
  // "ohos.permission.DISCOVER_BLUETOTH",
  // "ohos.permission.CAMERA",
  "ohos.permission.ACCESS_BLUETOOTH",
  "ohos.permission.APPROXIMATELY_LOCATION",
  "ohos.permission.LOCATION",
];

TaoYao.with(this.context)
  .runtime()
  .permission(this.permissions)
  .onGranted(permissions => {
    // Successful acquisition of access permissions
    // this.startScan();
    console.log("Access permissions acquired", permissions);
    this.toast("Access permissions acquired");
  })
  .onDenied(permissions => {
    /*
     * 1. Due to security and confidentiality requirements, the application cannot obtain permission for background location data through system dialog windows. The application must first request approximate location and precise location, then show the user a dialog window so they can open the corresponding settings in the system. If the user selects "always allow" access to location, the application will acquire permission for background location data.
     * 2. If the request for access permissions ends with the user's refusal, the system will no longer offer dialog windows to obtain these permissions. In this case, the application should display a dialog window to the user so they can open the corresponding settings in the system.
     */
    this.showPermissionDialog(permissions);
  })
  // Start requesting access permissions
  .request();
```// Если уже были получены права доступа к местоположению, то запрос на получение других прав доступа, таких как камера и Bluetooth, не выполняется;
// Я заметил, что если массив прав доступа содержит права доступа к местоположению, то будут запрошены только эти права. Если же нет прав доступа к местоположению, например, если запрашиваются права доступа к камере и Bluetooth, всё работает корректно.

Комментарий (0)

GitLife Service Account Задача создана

Вход Перед тем как оставить комментарий

Статус
Ответственный
Контрольная точка
Pull Requests
Связанные запросы на слияние могут быть закрыты после их объединения
Ветки
Дата начала   -   Крайний срок
-
Закрепить/Открепить
Приоритет
Участники(1)
1
https://api.gitlife.ru/oschina-mirror/zhongte-TaoYao.git
git@api.gitlife.ru:oschina-mirror/zhongte-TaoYao.git
oschina-mirror
zhongte-TaoYao
zhongte-TaoYao