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

KTKEddystoneManager centralState is always "unknown" (0) #73

Open
nashfive opened this issue Jan 17, 2019 · 1 comment
Open

KTKEddystoneManager centralState is always "unknown" (0) #73

nashfive opened this issue Jan 17, 2019 · 1 comment

Comments

@nashfive
Copy link

nashfive commented Jan 17, 2019

I followed the tutorial for the iOS integration for EddyStone with the SDK v2.0.1.

// somewhere in a view controller
KTKEddystoneManager *edsm = [[KTKEddystoneManager alloc] initWithDelegate:self];

if (edsm.centralState == CBCentralManagerStatePoweredOn) {
    [edsm startEddystoneDiscoveryInRegion:nil];
}
else {
    NSLog(@"Bluetooth is not powered on (%li)", edsm.centralState);
}

I also did it manually using a pure CBCentralManager and it works fine.

Your implementation feels wrong, since the status is not available right after the creation of the manager. I suspect that you forgot to rely on a CBCentralManagerDelegate call when the status has been updated:

- (void)centralManagerDidUpdateState:(CBCentralManager *)central {
    NSLog(@"central state: %li", central.state); // prints 5 (powered on)
   // Call a delegate to notify about the new central state
}
@cjd1884
Copy link

cjd1884 commented Nov 22, 2020

Any updates on this? @nashfive Did you, somehow, managed to get a different centralState? Keep getting 0 here. Core Bluetooth manager (CBCentralManager) state is 5 (poweredOn).

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