randdusing / ng-cordova-bluetoothle

Angular 1.x wrapper for the PhoneGap/Cordova Bluetooth Low Energy Plugin
Other
47 stars 34 forks source link

Start advertising not working iOS #28

Closed manuelprojects closed 8 years ago

manuelprojects commented 8 years ago

Hi All,

I'm trying to start advertising but I not able to receive callback, no error returned either from Safari Ispector either xCode inside the obj-c the plugin...

I'm testing it in iPhone 6 (iOs 9,3) and iPhone 5s (iOs 9.3.3)

I've tried a lot of times, the scan method work perfectly....

And another question... what is the diffrence between bluetoothle.initialize and initializePeripheral???


  .service('$lbeservice', function ($config, $http, $cordovaBluetoothLE) {
    return {

      uuid: null,

      init: function (uuid) {

        this.uuid = uuid;

        $this = this;

        $cordovaBluetoothLE.initialize({"request": true}).then(null,
          function(obj) {
            alert("ERRORE");
          },
          function(obj) {
            alert("INIT SUCCESS");
            $this.broadcast();
          }
        );
      },

      broadcast: function(){

        var params = {
          services: [this.uuid ],
          service: this.uuid
         };

        $cordovaBluetoothLE.startAdvertising(params).then(
          function(obj) {
            alert("START ADVERTISING SUCCESS: " + JSON.stringify(obj));
          },
          function(obj) {
            alert("START ADVERTISING ERROR: " + JSON.stringify(obj));
        });
      }

    };
  })

Many Thanks,

randdusing commented 8 years ago

Closing as a duplicate to https://github.com/randdusing/cordova-plugin-bluetoothle/issues/347

Please only post on cordova-plugin-bluetoothle unless it's specifically an Angular wrapper issue.