Reputation: 1105
if (self.advertisingSwitch.on) {
// All we advertise is our service's UUID
[self.peripheralManager startAdvertising:@{ CBAdvertisementDataServiceUUIDsKey : @[[CBUUID UUIDWithString:TRANSFER_SERVICE_UUID]] }];
}
else {
[self.peripheralManager stopAdvertising];
}
I have it translated in Swift as:
if self.advertisingSwitch.on {
self.peripheralManager.startAdvertising([CBUUID(string: TRANSFERSERVICEUUID)])
} else {
self.peripheralManager.stopAdvertising()
}
It is giving me the error: "cannot invoke StartAdvertising with argument list of type ([CBUUID])"
Upvotes: 0
Views: 164
Reputation: 1421
try this
if self.advertisingSwitch.on {
self.peripheralManager.startAdvertising([CBAdvertisementDataServiceUUIDsKey:[TRANSFER_SERVICE_UUID]])
} else {
self.peripheralManager.stopAdvertising()
}
Upvotes: 1