IBeaconAdvertisement
Helper class to help turn your Mac into an iBeacon (this is so much better than an iOS device)
Install / Use
/learn @nolim1t/IBeaconAdvertisementREADME
iBeaconAdvertisement
Helper class to help turn your Mac into an iBeacon (this is so much better than an iOS device)
Code
- Copy these two classes into your Mac project
- Libraries required: IOBluetooth
- Add the following code somewhere (such as your app delegate?) to implement the correct delegates
@interface ViewControllerOrAppDelegate () <CBPeripheralManagerDelegate>
@property (nonatomic,strong) CBPeripheralManager *manager;
@end
Add in the following method
- (void)peripheralManagerDidUpdateState:(CBPeripheralManager *)peripheral {
if (peripheral.state == CBPeripheralManagerStatePoweredOn) {
NSUUID *proximityUUID = [[NSUUID alloc] initWithUUIDString:@"E2C56DB5-DFFB-48D2-B060-D0F5A71096E0"];
BeaconAdvertisementUtil *beaconData = [[BeaconAdvertisementUtil alloc] initWithProximityUUID:proximityUUID
major:1
minor:1
measuredPower:-59];
[_manager startAdvertising:beaconData.beaconAdvertisement];
}
}
Where you want to start the broadcast, add in the following
_manager = [[CBPeripheralManager alloc] initWithDelegate:self
queue:nil];
Related Skills
node-connect
354.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
