【发布时间】:2014-07-17 11:37:53
【问题描述】:
就我而言,我希望通知每天只出现一次。
这是我的代码:
- (void)viewDidLoad
{
[super viewDidLoad];
/*
* BeaconManager setup.
*/
self.beaconManager = [[ESTBeaconManager alloc] init];
self.beaconManager.delegate = self;
NSUUID *uuid = [[NSUUID alloc] initWithUUIDString:@"xxxalotofnumbersxxx"];
self.beaconRegion = [[ESTBeaconRegion alloc] initWithProximityUUID: uuid
major: 41270
minor: 64913
identifier: @"RegionIdentifier"];
[self.beaconManager startMonitoringForRegion:self.beaconRegion];
}
- (void)beaconManager:(ESTBeaconManager *)manager didEnterRegion:(ESTBeaconRegion *)region
{
UILocalNotification *notification = [UILocalNotification new];
notification.alertBody = @"Test";
notification.applicationIconBadgeNumber = 1;
[[UIApplication sharedApplication] presentLocalNotificationNow:notification];
}
我可以尝试通过在开始后立即插入来很好地管理它?
if(notification.applicationIconBadgeNumber = 1;)
[self.beaconManager stopMonitoringForRegion:self.beaconRegion];
还有其他更好的解决方案吗?谢谢
【问题讨论】:
标签: ios uilocalnotification ibeacon