I'm working on an app , which use CBCentralManager functionality to connect band with iPhone. Band working fine with 5 and 5s, But disconnected just after connected with 6s , 6 plus , 7 and 7 plus . Please help me to solve this issue .
- (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral
{
self.connected = true;
[self.centralManager stopScan];
[self.data setLength:0];
peripheral.delegate = self;
NSString *serviceAddress = [NSString stringWithFormat:@"%x", MBServiceTypeDefault];
[peripheral discoverServices:@[[CBUUID UUIDWithString:IMMEDIATE_ALERT_SERVICE], [CBUUID UUIDWithString:ADVERTISED_SERVICE],[CBUUID UUIDWithString:serviceAddress]]];
}
- (void)peripheral:(CBPeripheral *)peripheral didDiscoverServices:(NSError *)error {
if (error) {
[self cleanup];
return;
}
for (CBService *service in peripheral.services) {
self.service = [peripheral.services firstObject];
[peripheral discoverCharacteristics:nil forService:service];
}
}