I am using Apple core bluetooth example .The peripheral is running in foreground in one iphone device.I am running cbcentral client application in one device.It is pairing well when both application in foreground condition.My need is when I run client cbcentral client in background , that delegate methods are not called in which I have mentioned local notification .the notification is not coming in background mode. Can I use NSOperation for running bluetooth delegate methods as we do NSUrlConnection? Will it work in latest iOS version? I checked it, but it is not working.
The code:
-(void) peripheral:(CBPeripheral *)aPeripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error
{
..............
...............
UILocalNotification *localNotif = [[UILocalNotification alloc] init];
localNotif.fireDate = [itemDate dateByAddingTimeInterval:-(minutesBefore*60)];
localNotif.timeZone = [NSTimeZone defaultTimeZone];
localNotif.alertBody = @"hi";
localNotif.alertAction = NSLocalizedString(@"View Details", nil);
localNotif.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
..............
}