监听用户进入,离开某个区域,需要请求获取用户的位置,如果想在后台也能监听,需要配置ios9后台监听
来源:互联网 发布:淘宝卖家开通直播 编辑:程序博客网 时间:2024/06/05 20:55
//// ViewController.m// MonitorRegion//// Created by hq on 16/5/17.// Copyright 2016年 hanqing. All rights reserved.//#import "ViewController.h"#import <CoreLocation/CoreLocation.h>@interface ViewController () <CLLocationManagerDelegate>@property(nonatomic,strong) CLLocationManager *clm;@end@implementation ViewController-(CLLocationManager *)clm{ if (_clm==nil) { _clm=[[CLLocationManager alloc]init]; _clm.delegate=self; if ([[UIDevice currentDevice].systemVersion floatValue]>=8.0) { [_clm requestAlwaysAuthorization]; } } return _clm;}- (void)viewDidLoad { [super viewDidLoad]; //设置中心点,传经纬度过去 CLLocationCoordinate2D center=CLLocationCoordinate2DMake(37.785834, -122.406417); //设置监听的区域 CLCircularRegion *region=[[CLCircularRegion alloc] initWithCenter:center radius:1000 identifier:@"hq"]; //开始监听 [self.clm startMonitoringForRegion:region];}-(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region{ NSLog(@"%@进入该区域",region.identifier);}-(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region{ NSLog(@"%@离开该区域",region.identifier);}- (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; }@end
0 0
- 监听用户进入,离开某个区域,需要请求获取用户的位置,如果想在后台也能监听,需要配置ios9后台监听
- android 通过GPS获取用户地理位置并监听位置变化
- android 通过GPS获取用户地理位置并监听位置变化
- android 通过GPS获取用户地理位置并监听位置变化
- asp.net监听用户请求地址
- Spring Boot实现一个监听用户请求的拦截器
- Android监听程序进入后台
- 监听用户电话状态
- UITextField 监听用户输入
- oracle创建监听,用户,配置客户端
- 一些 平常需要用到的 监听
- android手势监听需要注意的地方
- 【代码】android 通过GPS获取用户地理位置并监听位置变化
- Android——通过GPS获取用户地理位置并监听位置变化
- 监听 Chrome 控制台的用户操作.
- Android监听用户正在使用的程序
- [Android开发] 从后台恢复前台界面需要输入密码的demo|监听Home短按长按锁屏
- 实现鼠标进入进出div时位置的监听效果
- busybox find
- Android Studio添加第三方库
- 滚动条滚动,广告保持位置不变
- 蓝桥杯 填算式(JAVA)
- iOS 后台定位审核被拒How to clarify the purpose of its use in the location modal?
- 监听用户进入,离开某个区域,需要请求获取用户的位置,如果想在后台也能监听,需要配置ios9后台监听
- redis学习笔记1
- a
- Android关于手机适配的一些问题
- Apache Calcite:Hadoop中新型大数据查询引擎
- SBT安装与编译运行
- CLGeocoder 根据地理位置获取经纬度,根据经纬度获取地理位置
- iOS之如何自适应TableViewCell的高度
- Git bad permissions