问题
After app open, and Press ON BLE Device.
centralManagerDidUpdateState function is working.
CBUUID *uuid = [CBUUID UUIDWithString:@"8A1FEA41-3A2F-7860-568D-2325D6C31C91"];
NSArray *services = [NSArray arrayWithObjects:uuid, nil];
NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
[central scanForPeripheralsWithServices:services options:options];
Would not call to didDiscoverPeripheral: function.
-(void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI{
}
But if call nill value to scanForPeripheralsWithServices than will call to didDiscoverPeripheral: function.
[central scanForPeripheralsWithServices:nil options:options];
What is issue? Please.
来源:https://stackoverflow.com/questions/21826693/not-working-call-to-centralmanager-diddiscoverperipheral-advertisementdata-rs