로컬 알림을 사용하여 특정 지역에서 들어가거나 나가면 사용자에게 알리는 iBeacon 응용 프로그램을 개발 중입니다. 하지만 백그라운드에서 응용 프로그램을 사용할 때 알림이 한 번만 표시됩니다. 어떤 도움을 주시면 감사하겠습니다.UILocalNotification iOS7에서 한 번만 발생합니다.
- (void)locationManager:(CLLocationManager*)manager didEnterRegion:(CLRegion *)region {
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.fireDate = nil;
notification.alertBody = @"Welcome";
notification.alertAction = @"View";
notification.soundName = UILocalNotificationDefaultSoundName;
notification.applicationIconBadgeNumber = 0;
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
-(void)locationManager:(CLLocationManager*)manager didExitRegion:(CLRegion *)region {
UILocalNotification *notification = [[UILocalNotification alloc] init];
notification.fireDate = nil;
notification.alertBody = @"Thank you for coming";
notification.alertAction = @"View";
notification.soundName = UILocalNotificationDefaultSoundName;
notification.applicationIconBadgeNumber = 0;
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
"한 번만"을 의미하는 것은 지역을 입력하거나 지역을 떠날 때처럼? – rckoenes
내가이 지역에 들어서 자마자 더 이상 통보를받지 못했다. 응용 프로그램이 포 그라운드에있는 경우 알림을 얻으려면 –