-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{// Override point for customization after application launch.UIUserNotificationTypetypes=UIUserNotificationTypeBadge|UIUserNotificationTypeSound|UIUserNotificationTypeAlert;UIUserNotificationSettings*mySettings=[UIUserNotificationSettingssettingsForTypes:typescategories:nil];[[UIApplicationsharedApplication]registerUserNotificationSettings:mySettings];returnYES;}-(void)application:(UIApplication*)applicationdidRegisterUserNotificationSettings:(UIUserNotificationSettings*)notificationSettings{UIUserNotificationTypeallowTypes=[notificationSettingstypes];}-(void)getReadyForNotification{UIUserNotificationSettings*currentNotificationSettings=[[UIApplicationsharedApplication]currentUserNotificationSettings];[selfcheckSetting:currentNotificationSettings];}
//Location NotificationCLLocationManager*locMan=[[CLLocationManageralloc]init];locMan.delegate=self;[locManrequestWhenInUseAuthorization];#pragma mark - CLLocationManager-(void)locationManager:(CLLocationManager*)managerdidChangeAuthorizationStatus:(CLAuthorizationStatus)status{BOOLcanUseLocationNotifications=(status==kCLAuthorizationStatusAuthorizedWhenInUse);if(canUseLocationNotifications){[selfstartShowLocationNotification];}}-(void)application:(UIApplication*)applicationdidReceiveLocalNotification:(UILocalNotification*)notification{CLRegion*region=notification.region;if(region){}}-(void)startShowLocationNotification{CLLocationCoordinate2Dlocal2D;local2D.latitude=123.0;local2D.longitude=223.0;UILocalNotification*locNotification=[[UILocalNotificationalloc]init];locNotification.alertBody=@"你接收到了";locNotification.regionTriggersOnce=YES;locNotification.region=[[CLCircularRegionalloc]initWithCenter:local2Dradius:45identifier:@"local-identity"];[[UIApplicationsharedApplication]scheduleLocalNotification:locNotification];}