Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70747

Bluetooth Serial Enable not work

$
0
0

@m7modg97 wrote:

I’m trying to enable Bluetooth if it is not enabled, firstly I check if Bluetooth enabled, if not I try to enable it.
There is my code :

//Check If Bluetooth Enabled Or Not
    this.bluetoothSerial.isEnabled().then(
      function() {
        alert("YES");
    },
      function() {
        alert("NO");
        this.enableBluetooth();
      }
    )

“enableBluetooth” function :

  enableBluetooth(){
    this.bluetoothSerial.enable().then(
      success => {
        alert("Bluetooth is enabled");
      }, failure => {
        alert("The user did *not* enable Bluetooth");
      }
    ); 
  }

I run the application through “Ionic DevApp”.
If I run on chrome browser I get this error in console:

Device: Android.
Used Library: https://ionicframework.com/docs/native/bluetooth-serial

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70747

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>