Git Product home page Git Product logo

Comments (11)

JWesorick avatar JWesorick commented on June 6, 2024 3

@dipakchandranp Same for me. The promise is always returning false on iOS.

from cordova-plugin-ibeacon.

parkej60 avatar parkej60 commented on June 6, 2024 1

Also unable to get the isEnabled to return true.

from cordova-plugin-ibeacon.

mrtree1 avatar mrtree1 commented on June 6, 2024

@sunsus Yes that's been one of my irritations for a while, and it's been asked before. It's on the TODO list.

from cordova-plugin-ibeacon.

mrtree1 avatar mrtree1 commented on June 6, 2024

Now added for Android

from cordova-plugin-ibeacon.

deantomasevic avatar deantomasevic commented on June 6, 2024

@mrtree1 For iOS too?

from cordova-plugin-ibeacon.

mrtree1 avatar mrtree1 commented on June 6, 2024

The bluetooth check is supported on iOS, the enable/disable isn't. I'm less familiar with iOS and didn't have time to investigate how to do this. I wasnt even sure if its necessary. There are stub functions there if anyone wants to push code to do this.

from cordova-plugin-ibeacon.

deantomasevic avatar deantomasevic commented on June 6, 2024

Okay thank you.
How can i activate the autocheck (and the popup "please turn on your bluetooth") if the app starts?

app.run(function($ionicPlatform, $rootScope, Restangular, SETTINGS) {
    $ionicPlatform.ready(function() {

      if(window.cordova && window.cordova.plugins.Keyboard) {
        cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
      }
      if(window.StatusBar) {
        StatusBar.hide();
      }

      cordova.plugins.locationManager.isBluetoothEnabled()
          .then(function(isEnabled) {
              if (isEnabled) {
                console.log("Bluetooth is enabled: " + isEnabled);
                $rootScope.isBLEnabled = isEnabled;
              } else {
                console.log("Bluetooth is disabled: " + isEnabled);
                $rootScope.isBLEnabled = isEnabled;
              }
          })
          .fail(console.error)
          .done();

      window.locationManager = cordova.plugins.locationManager;
      startBeaconScan();
      updateTimer = setInterval(displayBeaconList, 1000);
    });

from cordova-plugin-ibeacon.

mrtree1 avatar mrtree1 commented on June 6, 2024

I'm not near the code, but for most of the plugins operations you need to register the callback delegate first. Also not knowing ionic I can't tell if there might be any other issues but otherwise that looks right.

from cordova-plugin-ibeacon.

deantomasevic avatar deantomasevic commented on June 6, 2024

Okay @mrtree1
Do you have an example how i can trigger the "please turn on your bluetooth" Dialog?
Thank you!

from cordova-plugin-ibeacon.

mrtree1 avatar mrtree1 commented on June 6, 2024

No I don't. But for iOS the permissions have to be explicitly requested. Have a look at requestWhenInUseAuthorization and requestAlwaysAuthorization calls on the plugin.

from cordova-plugin-ibeacon.

dipakchandranp avatar dipakchandranp commented on June 6, 2024

I am trying to check if bluetooth is enabled in iOS device using the following code structure and it always (even bluetooth is enabled or disabled) gives me false for isEnabled.

cordova.plugins.locationManager.isBluetoothEnabled()
        .then((isEnabled) => {
            if(isEnabled){
                return true;
            }else{
                alert("Please enable your bluetooth and reload. Thanks!");
                return false;
            }
        })

How to do this? I have seen some comments it says, its able to detect in iOS. How to achieve this?
Thanks.

from cordova-plugin-ibeacon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.