Reputation: 63
IOS is only advertising one service despite me specifying two service UUID's and services, i don't get any errors, and the add service error function is called twice, both times without error, this is my code
for UUIDs in advertisingUUIDs
{
self.mainServicesArray.append(CBMutableService(type: UUIDs, primary: true))
}
for services in mainServicesArray
{
self.peripheralManager.addService(services)
}
self.peripheralManager.startAdvertising([CBAdvertisementDataServiceUUIDsKey: [mainServicesArray[0].UUID,mainServicesArray[1].UUID]])
The rest of the code runs fine, in the example I've put there it will advertise the first of the two services, the order doesn't matter the first one is always advertised the second not, so the UUID's are valid as are the services it just won't advertise them both, I'm sure its something simple but I'm stuck.
Thanks
Upvotes: 0
Views: 152
Reputation: 63
The reason is the second UUID doesn't fit in the advertising packet.
The second service is still not shown when i scan the connected device though, but thats another problem.
Upvotes: 0