Questions tagged [cbcentralmanager]

CBCentralManager is an object used by CoreBluetooth on OS X and iOS to manage peripheral devices.

CBCentralManager is an object used by CoreBluetooth on OS X and iOS to manage peripheral devices. On CBCentralManager, you can find the following methods:

Initializing a Central Manager

– initWithDelegate:queue:

– initWithDelegate:queue:options:

Establishing or Canceling Connections with Peripherals

– connectPeripheral:options:

– cancelPeripheralConnection:

Retrieving Lists of Peripherals

– retrieveConnectedPeripheralsWithServices:

– retrievePeripheralsWithIdentifiers:

– retrieveConnectedPeripherals Deprecated in iOS 7.0

– retrievePeripherals: Deprecated in iOS 7.0

Scanning or Stopping Scans of Peripherals

– scanForPeripheralsWithServices:options:

– stopScan

Monitoring Properties

state property

delegate property

235 questions
2
votes
0 answers

iOS 13.5 Core Bluetooth - Scanning scanForPeripherals(withServices:) does not discover any peripheral

I'm writing a very basic App that shall scan the environment for peripherals that provide a specific service and displays the device IDs and the RSSI in a table view. Nothing special. Here is what I'm trying: extension BLEScanner:…
2
votes
1 answer

didDiscoverPeripheral: not working sometimes on background

Happens both on iOS 12 & iOS 13. I have Bluetooth-central correctly added on my Info.plist I'm specifying a list of service UUIDs What I am seeing: If I interact with our BLE device on the foreground, I can still scan for it on background, even…
2
votes
1 answer

Not Getting Bluetooth Authorization Prompt in Xamarin iOS

I've had a Xamarin Forms application with a binding to a native bluetooth SDK that's been working beautifully on iOS 12. On iOS 13 the application crashes. I'm assuming this is around the new Bluetooth privacy settings. But despite initialising an…
Stephen Hewison
  • 324
  • 2
  • 9
2
votes
2 answers

CBPeripheral.ancsAuthorized info is unreliable

Our app works with a paired Bluetooth peripheral that uses ANCS, that is why I dug early into the brand new privacy setting "Share System Notifications" to make our app ready for iOS13... However there is an issue, the CBPeripheral property…
JBA
  • 2,889
  • 1
  • 21
  • 38
2
votes
0 answers

iOS11 - "Turn on Bluetooth" prompt not working

I am using bluetooth in my app to work with iBeacons (Location Services) Since iOS11, and the new functionality brought in Control Center, my bluetooth prompts don't show when turning bluetooth off via Control Center. But when I turn bluetooth off…
mhorgan
  • 886
  • 2
  • 11
  • 32
2
votes
1 answer

WillRestoreState not called when app killed by the system

Im trying to create an application which connects to a BP cuff. I want to enable state restoration in the app so that even if the app is killed by the system the app can still be invoked when the BP cuff is available and transmitting. Here are some…
2
votes
1 answer

How to convert CBCharacteristic.value to NSString in Objective C

I have been unable to convert CBCharacteristic's value property which is of type NSData to NSString. I tried the usual initWithData:encoding: method of NSString as given below. But it returns nil. NSString *str = [[NSString alloc]…
2
votes
1 answer

In iOS 10+, is there ANY way to RELIABLY wake up an app

I have been at this over 3 months and pulling my hair out. So please don't respond with beginner answers. I am wondering if, in 2017 with iOS 10+, there is ANY way possible to wake up the app from terminated state... preferably by bluetooth…
GoreDefex
  • 1,461
  • 2
  • 17
  • 41
2
votes
2 answers

CoreBluetooth - didDiscoverPeripheral never called for specific serviceUUIDs but works for nil

I am scanning for bluetooth devices. For that I am using CBCentralManager, like so - (void)startScanning { [self.centralManager scanForPeripheralsWithServices:nil options:@{ CBCentralManagerScanOptionAllowDuplicatesKey : @YES }]; } -…
mag_zbc
  • 6,801
  • 14
  • 40
  • 62
2
votes
0 answers

iOS BLE Error Reading Characteristic: Reading is not permitted

I have a ble device that I can connect to, but the problem is that I cannot read the characteristics from it. Here is the process: Scanning the device = OK Peripheral is discoverable = OK Connection = OK Request all the characteristics available…
Jongers
  • 595
  • 1
  • 9
  • 29
2
votes
1 answer

Not able to scan Through CBCentral Manager with service ID for iBecon Signal

Working on iBecon signal using Core Bluetooth i am able to search with CBCentralManager scan optionn nil :- Shared.sharedInstance.centralManager?.scanForPeripherals(withServices: nil, options:[CBCentralManagerScanOptionAllowDuplicatesKey:true]) But…
2
votes
0 answers

Setting up and sending a string with Peripheral Manager swift

I have gone and set up my CBCentralManager to search for devices and have the basic structure ready to receive and check on updated info. I just cant seem to grasp on how to make a CBPeripheralManager ViewController and how to send my CBCentral…
2
votes
0 answers

Why there's a requirement of reconnecting to a BLE device every time?

I have a CBPeripheral which accepting different commands for communications. For example: If I need to fetch current rate from the device, the command is "get-rate". If I need to fetch current battery level of the device, the command is…
Hemang
  • 26,840
  • 19
  • 119
  • 186
2
votes
1 answer

iOS Bluetooth Background Connected Peripheral

I'm implementing Core Bluetooth background mode and have gotten to the willRestoreState method successfully. The system properly handles scanning and waking up my app on service advertisement and incoming data. However, if the device is already…
NewEndian
  • 559
  • 2
  • 16
2
votes
1 answer

Beacon is not discovering iOS

I am trying to discover the ibeacon. i am running app on iPhone 4s. device bluetooth is turned on. beacon is also discovering in other iOS apps. When i am searching for services following delegate "centralManagerDidUpdateState" gets called and State…
Dattatray Deokar
  • 1,923
  • 2
  • 21
  • 31