When i connect my device to my peripheral, he asks me a passkey (a pop-up is shown on the device). I want to send this passkey programmatically during the connection.

I'm using CBCentralManager but I can't find a way to send it.

Any suggestions?

有帮助吗?

解决方案

You can't do this. This is part of the security model. If your BLE peripheral specifies that encryption is required to access one of its characteristics then pairing is required. The passkey is collected by iOS, not your application, and your application does not have any access to the passkey or the pairing/bonding process

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top