I manage to successfully connect and pair with peripherals in the foreground. But when I try to connect from the background, the peripheral connection connects and then disconnects immediately with the following errors:
BTServer[67] <Error>: LE pairing failed to device "F90..." with result 1
BTServer[67] <Error>: ATT no characteristic values with UUID 0x2A00 could be read in range [0x0001, 0x0007] on device "F90..."
BTServer[67] <Error>: Aborting command as device "F90..." is no longer connected
It seems strange, because the peripherals are already paired, and nothing like this happens when the application is in the foreground.
This only happens in iOS 8. On iOS 7, the same code works fine both in the background and in the foreground.
source
share