Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS8 As Beacon not working #134

Open
cfh463 opened this issue Mar 17, 2015 · 2 comments
Open

iOS8 As Beacon not working #134

cfh463 opened this issue Mar 17, 2015 · 2 comments
Assignees
Milestone

Comments

@cfh463
Copy link

cfh463 commented Mar 17, 2015

I am running your sample code to start a device as a Beacon (iOS8).

I am getting

Advertising is accepted, but won't start until peripheral manager is powered on.

But Bluetooth is powered on. Also the promise does not error in this scenario

cordova.plugins.locationManager.isAdvertisingAvailable()
    .then(function(isSupported){

        if (isSupported) {
            cordova.plugins.locationManager.startAdvertising(beaconRegion)
                .then(function(){
                  console.log('Beacon Started');
                })
                .fail(function(e){
                  console.log('Could not start');
                  console.log(JSON.stringify(e));
                  })
                .done();
        } else {
            console.log("Advertising not supported");
        }
    })
    .fail(console.error)
    .done();

Logs:

(lldb) 2015-03-17 13:03:38.699 beacontest[1166:437710] [Default measuredPower will be used.
2015-03-17 13:03:38.700 beacontest[1166:437710] Advertising is accepted, but won't start until     peripheral manager is powered on.
(lldb) 2015-03-17 13:03:38.715 beacontest[1166:436366] Beacon Started
@cfh463
Copy link
Author

cfh463 commented Mar 17, 2015

Making progress but still not out of woods. I added to the pList:

<key>UIBackgroundModes</key>
<array>
  <string>bluetooth-peripheral</string>
</array>

And was prompted when the app started to allow sending BT data. It also shows up in the Settings/App page as Bluetooth Sharing (On toggle)

But I still get
Advertising is accepted, but won't start until peripheral manager is powered on

@cfh463
Copy link
Author

cfh463 commented Mar 17, 2015

OK looks like my two devices are an Iphone4 and an iPad 2 - even though these both have been upgraded to OS'es that support BTLE, the actual hard ware does not.

You need: actual device which supports BLE (iPhone 4S and up, iPad mini and iPad 3 and up)

I would still like to keep this open as it should return a fail when called.

The clue that led me to find the answer was a few lines up in the log:

{"eventType":"peripheralManagerDidUpdateState","state":"PeripheralManagerStateUnsupported

@petermetz petermetz self-assigned this Sep 2, 2017
@petermetz petermetz added this to the v4.0 milestone Sep 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants