Aşağıdaki, işaretini algılayan kodumdur, ancak arka planda olduğunda bildirim göndermez. kimse tam olarak kodArka Plan Bildirimi EconbronconManager'ı kullanarak iOS iOS
@property (nonatomic) ESTBeaconManager *beaconManager;
@property (strong, nonatomic) CLBeaconRegion *beacRegion;
@property (strong, nonatomic) NSArray *estimoteBeacons;
- (void)viewDidLoad {
self.beaconManager = [ESTBeaconManager new];
self.beaconManager.delegate = self;
self.beaconManager.returnAllRangedBeaconsAtOnce = YES;
self.beacRegion = [[CLBeaconRegion alloc] initWithProximityUUID:[[NSUUID alloc] initWithUUIDString:@"xxxxxx-xxxx-xxxx-xxxx-..."] major:000 minor:0000 identifier:[NSString stringWithFormat:@"%@", @"HEY GUYS!"]];
[self.beaconManager startRangingBeaconsInRegion:self.beacRegion];
[self.beaconManager startMonitoringForRegion:self.beacRegion];
}
- (void)beaconManager:(id)manager didEnterRegion:(CLBeaconRegion *)region
{
NSLog(@"didEnterRegion");
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.alertBody = @"You have entered the region you are monitoring";
localNotification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication]presentLocalNotificationNow:localNotification];}
- (void)beaconManager:(id)manager didEnterRegion:(CLBeaconRegion *)region
{
NSLog(@"didEnterRegion");
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.alertBody = @"You have left the region you are monitoring";
localNotification.soundName = UILocalNotificationDefaultSoundName;
[[UIApplication sharedApplication]presentLocalNotificationNow:localNotification];}
ile sorunun ne olduğunu bulabilir misin ben cihazın yığın izlemesi görünce bu mesajı alıyorum:
"-iPhone ESTBeacon [1366]: monitoringDidFailForRegion Yetersiz Konum Servisleri yetkilendirme. İzleme, uygun yetki verilinceye kadar durur. " Senin uygulamanın konum izinleri verildi henüz şüpheli bilgi plist
yapılandırılmış ibeacon veya eddystore kullanıyor: sizin plist bir giriş ek olarak, böyle bir şey gerekiyor? –