【发布时间】:2016-12-19 11:30:05
【问题描述】:
我将在我的应用程序中使用 iBeacon。打开应用程序时,是否可以在其上写入值。如果是,我该如何实现。通过使用 coreBluetooth,我可以做到这一点。
NSData *bytes = [@"0xDE" dataUsingEncoding:NSUTF8StringEncoding];
[peripheral writeValue:bytes forCharacteristic:characteristic
type:CBCharacteristicWriteWithResponse];
【问题讨论】:
-
如果您详细阅读 iBeacon,您会发现所有 iBeacon 都有一些静态 ID,通过这些 ID 可以识别特定的信标。您可以使用该 ID 来识别和存储该信标的数据。为了更方便,请遵循这个 sdk:developer.estimote.com/ibeacon/tutorial/part-1-setting-up
-
如果 iBeacon 允许“经典 BLE”模式,并且它具有可写特性,是的,您可以。
标签: ios objective-c bluetooth-lowenergy ibeacon core-bluetooth