It seems that this question was “answered” here , but without any code to show what they did differently, I need to ask a new question.
I have my own code with the same behavior when scanning for specific CBUUIDs using Core Bluetooth CBCentralManager in OS X does not detect an iOS device acting as a peripheral device with CBPeripheralManager (unless it and its services were previously discovered). To find out if this is not the case in my code, I downloaded a sample Apple code . Running the sample code on two iOS devices works as intended, but when you copy the CBCentralManager code to the OS X application, it cannot find the iOS device.
I downloaded the Xcode project for an OS X application, hosted on WikiUpload , as it seems the least tricky. There is also a copy on my hosting if people prefer.
The AppDelegate.m code has also been added here in the OS X project (CoreBluetooth infrastructure is connected in the project):
And in AppDelegate.h there are UUID definitions:
#ifndef LE_Transfer_TransferService_h #define LE_Transfer_TransferService_h #define TRANSFER_SERVICE_UUID @"E20A39F4-73F5-4BC4-A12F-17D1AD07A961" #define TRANSFER_CHARACTERISTIC_UUID @"08590F7E-DB05-467E-8757-72F6FAEB13D4" #endif
What is the problem? According to the above question, the service should be part of the proposal package, but as far as I can see, exactly what the iOS peripheral does with
[self.peripheralManager startAdvertising:@{ CBAdvertisementDataServiceUUIDsKey : @[[CBUUID UUIDWithString:TRANSFER_SERVICE_UUID]] }];
source share