iosmicrosoft-band

Microsoft Band SDK Band Contact Update


I am Nam Nguyen, I am using Microsoft Band SDK for iOS (Microsoft Band 2). I have a question that how I can get the BandContact’s state at the beginning. I tried to implement

[client.sensorManager startBandContactUpdatesToQueue:nil errorRef:&err withHandler:^(MSBSensorBandContactData *contactData, NSError *error) {
    NSLog(@"BandContact Updated");
}];

But, unfortunately, @"BandContact Updated” only fired when I change the state: take the band off or wear it back. Please Advise.

Thanks and best regards,


Solution

  • When the first call to startBandContactUpdates is made, the handler block is invoked right away with the current Band state and after that only Band state changes are delivered. Subsequent startBandContactUpdates calls will also not deliver the current Band state unless you explicitly stopBandContactUpdates and start again. So in short, try to stopBandContactUpdates before starting them (incase you had already started elsewhere in your app).