BLE Cordova plugin asks for LOCATION but never for BLUETOOTH

I’m using the BLE cordova plugin in my new app. My app is written with Ionic v5 and Angular 9.

Here is the code that scan for available devices:

import { Component, OnInit } from '@angular/core';
import { AndroidPermissions } from '@ionic-native/android-permissions/ngx';
import { BLE } from '@ionic-native/ble/ngx';
import { LoadingController, Platform } from '@ionic/angular';

@Component({
  selector: 'app-test',
  templateUrl: './test.page.html',
  styleUrls: ['./test.page.scss'],
})
export class TestPage implements OnInit {

  devices: any[] = [];

  constructor(
    private platform: Platform,
    private androidPermissions: AndroidPermissions,
    private ble: BLE,
    private loadingCrl: LoadingController
  ) { }

  ngOnInit() {
    this.platform.ready().then(() => {
      if (this.platform.is('android') || this.platform.is('ios')) {
        if (this.platform.is('android')) {
          this.androidPermissions
            .requestPermissions([
              this.androidPermissions.PERMISSION.BLUETOOTH_ADMIN,
              this.androidPermissions.PERMISSION.BLUETOOTH
            ])
            .then(() => this.scan());
        } else {
          this.scan();
        }
      }
    });
  }

  scan() {
    this.loadingCrl.create({ message: 'Scanning...' }).then(loading => {
      loading.present();
      console.log('Scanning...');
      this.ble.scan([], 5).subscribe(device => {
        console.log(JSON.stringify(device));
        this.devices.push(device);
        loading.dismiss();
      });
    });
  }

}

The app asks for location permissions but doesn’t ask for bluetooth. The scanning runs forever.
I run my app on an Android 9 device with:

ionic cordova run android -l

You must enable the BLE actually:

import { Component, OnInit } from '@angular/core';
import { BLE } from '@ionic-native/ble/ngx';
import { LoadingController, Platform } from '@ionic/angular';

@Component({
  selector: 'app-test',
  templateUrl: './test.page.html',
  styleUrls: ['./test.page.scss'],
})
export class TestPage implements OnInit {

  devices: any[] = [];

  constructor(
    private platform: Platform,
    private ble: BLE,
    private loadingCrl: LoadingController
  ) { }

  ngOnInit() {
    this.platform.ready().then(() => {
      if (this.platform.is('android') || this.platform.is('ios')) {
        if (this.platform.is('android')) {
          this.ble.enable().then(() => this.scan());
        } else {
          this.scan();
        }
      }
    });
  }

  scan() {
    this.loadingCrl.create({ message: 'Scanning...' }).then(loading => {
      loading.present();
      console.log('Scanning...');
      this.ble.scan([], 5).subscribe(device => {
        console.log(JSON.stringify(device));
        this.devices.push(device);
        loading.dismiss();
      });
    });
  }

}

Hi Cyrlifr,

I tried the same code as it is but still not working and it is not listing any devices. App showing the spinner continuously. It neither going to success nor error callback. I am ble-central plugin version 1.2.5. Tried with 1.3.1 as well. Kindly share a possible solution.