iPad Pro 3rd-gen and Apple Pencil2 is coming, I am going to prepare the update for my drawing app. But I am not going to buy the new devices, then the question is, how to modify the Apple Pencil detection code for the new device?
Current code is as below,
if ([central state] == CBManagerStatePoweredOn)
{
// Device information UUID
NSArray* myArray = [NSArray arrayWithObject:[CBUUID UUIDWithString:@"180A"]];
NSArray* peripherals = [m_centralManager retrieveConnectedPeripheralsWithServices:myArray];
for (CBPeripheral* peripheral in peripherals)
{
if ([[peripheral name] containSubstring:@"Apple Pencil"])
{
// The Apple pencil is connected
self.stylusType = Stylus_ApplePencil;
[self.delegate didConnectStylus:Stylus_ApplePencil];
}
}
}
The uuid of Apple Pencil 1st-gen is "180A", what's is the new uuid and peripheral name then?