iPhone Bluetooth pairing without confirming passcode - ios

In my BLE app, the user story is like, bluetooth pairing should happen without the passcode confirmation step. As far as i have researched so far, it is possible in Android (like Android Bluetooth Pairing without User Enter Pin and Confirmation Using Android API)
Is it possible in iPhone?

Sadly, on iOS it is not possible to skip the pairing dialog. It is directly sent from the OS. It is a strict convention from apple that apps are not able to skip security processes.
Some additional information:
Dependent on the IOCapabilityResponse from the peripheral device on bluetooth level iOS will show you a dialog asking to pair or to confirm a pass code. If iOS will show you the dialog at all depends if the bondable flag is set in the IOCapabilityResponse from the peripheral.

There are three types of connection in BLE:
connection: pin not required, connection not secure
pair: pin could be requested or not, connection secured with short term key, a popup will be displayed
bond: pin could be requested or not, connection secured with long term
key, a popup will be displayed
All of these method are managed by BLE peripheral firmware, iOS only adapts its connection based on how the peripheral is configured

Related

How do I initiate pairing with a BLE peripheral that uses unprotected ATT attributes?

We are developing an iOS app that must pair (and bond) with a BLE peripheral before our app can proceed with other steps. From what I understand Apple wants accessories to follow this flow to initiate pairing:
iOS device connects to accessory
iOS device attempts to access an attribute that requires special permissions (e.g. authenticated connection or encrypted connection)
Accessory rejects the attribute access with an “Insufficient Authentication” error code
iOS realizes it needs to initiate pairing, so it generates a pairing popup that allows the user to initiate it
The problem is that the firmware on our BLE peripheral can not be altered. All of its BLE attributes are unprotected and do not require an encrypted or authenticated connection to access these attributes. So in this case, how can we get iOS to generate the pairing popup so that the user will have the ability to pair?
I realize that my question is related to How to bond/pair to a bluetooth LE device programmatically in swift Xcode?, but it differs in that we can not change the permissions used by the characteristics of our BLE peripheral. We have no control over the firmware.
Thanks in advance.

iOS - Bypass Pairing alert for bluetooth

I'm using Core Bluetooth framework in my iOS app to communicate securely with BT devices. In my product, server sends a pairing code that user has to enter in the text box in peripheral device’s alert to complete the pairing process. It's working good.
As server sends the code, without showing the pairing alert, can I by-pass the alert and handle the code that pairs the device without user's intervention.
No, if you are using encryption on any of your characteristics an attempt to read or write that characteristic will trigger the iOS pairing dialog.
Your app has no direct access to the pairing process as it happens outside of your app.

iOS: Does a pairing window always display when connecting to a BLE device?

I want to avoid the BLE pairing pop up window on iOS when connecting to a small disposable device. The device will only be used once. If the device is advertising for its lifetime (no more than a few minutes) and does not require encrypted communication. Will an app that I develop be able to directly communicate with the device without displaying a pairing popup?
The pairing pop up is only shown if a characteristic specifies that encryption is required. If no encryption is specified by the peripheral then no pairing dialog is shown.
If you aren't getting the behaviour you desire, you need to change your peripheral or not access the encrypted characteristic from your central.
If you pair the devices, then the user must accept that. But if you just connect and communicate with GATT characteristics that don't need pairing, you don't need to pair and hence no popup.

Removing PIN in Core Bluetooth Connection

I'm working on an application that connects phones via core bluetooth (BLE). The connection and data transmission work beautifully, but there is one small imperfection. When connecting to a new device, a pin must be entered on one of the devices. The application is supposed to be very instantaneous, and the pin-input greatly interrupts this process. I'm not worried about security, and I've personally connected my phone to many bluetooth devices without entering pins, so I was just wondering how this could be done with the iOS api.
Thanks!
If you specify any of your peripheral's characteristics with an 'encryptionRequired' property (CBCharacteristicPropertyNotifyEncryptionRequired or CBCharacteristicPropertyIndicateEncryptionRequired) or permissions (CBAttributePermissionsReadEncryptionRequired or CBAttributePermissionsWriteEncryptionRequired) then bonding is required between the devices.
If the devices aren't already bonded then this will trigger the pairing dialog and require a pin to be entered. If you don't specify any of the encryption properties or permissions on your peripheral's characteristics then you won't be prompted to pair.

Objective-C Disabled iOS BLE Pairing Message

Is there anyway to disable the pairing message in iOS for a bluetooth device? The device I'm connecting to does not require any security and there is no pairing mechanism in place so having the message pop up is not needed. Any suggestions?
To confirm Paulw11's comment above a Pairing prompt will be displayed in iOS when a device is connected and any type of encryption is requested during the connection or encryption is required when writing to a characteristic.
If the user clicks "Cancel" the encryption will not be enabled for the connection, but the connection will not be terminated. If you click "Pair" encryption will be enabled and the connection will also persist.
There is no way to listen or interact with the pairing prompt via the base iOS configuration through the CoreBluetooth Framework. I've talked with Apple about this and done lots of digging. There may be a way to do this through the MFI program, but obviously we can't talk about that.

Resources