Having done some research around this problem, I don’t think that this is something you can get around (if it isn’t the way I commented on a custom warning, which should be easy to track by looking for some code that generates a warning!). No matter which headset you are trying to connect to, you are requesting a secure connection, and CoreBluetooth generates this warning. And as far as I know, there is no way to use a warning in the code.
From the Apple documentation for the Bluetooth ( https://developer.apple.com/library/mac/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/BestPracticesForSettingUpYourIOSDeviceAsAPeripheral/BestPracticesForSettingUpYourIOSDeviceAsAPeripheral.html#//apple_ref/doc/uid/TP40013257-CH5-SW7 )
Depending on the use case, you may want to sell a service that has one or more characteristics, the value of which should be safe. For example, imagine that you want to sell a social media profile service. This service may have characteristics whose values are elements of profile information, such as first name, last name, and email address. Most likely, you want to allow only trusted devices to receive email members.
You can guarantee that only trusted devices have access to sensitive characteristic values by setting the appropriate attribute of the property and resolution. To continue the example above, allow only trusted devices to retrieve members' email addresses, set the appropriate properties properties and permissions, for example:
emailCharacteristic = [[CBMutableCharacteristic alloc] initWithType:emailCharacteristicUUID properties:CBCharacteristicPropertyRead | CBCharacteristicPropertyNotifyEncryptionRequired value:nil permissions:CBAttributePermissionsReadEncryptionRequired]; In this
For example, this setting is configured to allow only trusted devices to read or subscribe to its value. When a connected, remote central tries to read or subscribe to this feature, Core Bluetooth tries to connect the local peripheral to the central to create a secure connection.
For example, if the center and peripheral devices are iOS devices, both devices receive a warning indicating that the other device wants for a pair. A warning on the central device contains a code that you must enter in the peripheral device warning text box to complete the pairing process.
After the pairing process is completed, the peripheral device considers the paired central trusted device and allows central access to its encrypted feature values.
If you receive this warning, then the BlueTooth headset you are trying to connect to requires a secure connection for one of the features you are trying to access. More information can be found on @koshyyyk here, here stackoverflow.com/a/18226632/1112794. There is also an Apple Developer report on BlueTooth and a pairing concept related in the comments, which I will duplicate here: http://adcdownload.apple.com//videos/wwdc_2012__hd/session_705__advanced_core_bluetooth.mov
If you have developer access to the device, you can disable it. If not, then you can either not use this symptom or find out how to work with a warning in your application.
EDIT My code for BLE that does not raise a warning (in case it matters). This project is adapted from the open source BLE Red Bear Lab code found here: https://github.com/RedBearLab/iOS
- (void) connectPeripheral:(CBPeripheral *)peripheral { NSLog(@"Connecting to peripheral with UUID : %@", peripheral.identifier.UUIDString); [self.activePeripherals addObject:peripheral]; [self.CM connectPeripheral:peripheral options:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:CBConnectPeripheralOptionNotifyOnDisconnectionKey]]; } - (int) findBLEPeripherals:(int)timeout { if (self.CM.state != CBCentralManagerStatePoweredOn) { NSLog(@"CoreBluetooth not correctly initialized !"); return -1; } [NSTimer scheduledTimerWithTimeInterval:(float)timeout target:self selector:@selector(scanTimer:) userInfo:nil repeats:NO]; [self.CM scanForPeripheralsWithServices:nil options:nil]; return 0;