web定位处理

【一】、iOS8

1.导入头文件 #import <CoreLocation/CoreLocation.h>

2.在info.plist中设置配置

NSLocationWhenInUseDescription

NSLocationAlwaysUsageDescription

3.在webview需要定位的地方添加如下代码

@property (nonatomic, strong) CLLocationManager *locationMgr;
  if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8) {

                //由于IOS8中定位的授权机制改变 需要进行手动授权
                  self.locationMgr = [[CLLocationManager alloc] init];

                  //获取授权认证
                  [self.locationMgr requestAlwaysAuthorization];
                  [self.locationMgr requestWhenInUseAuthorization];
       }

 

【二】、安卓

http://blog.csdn.net/shuyou612/article/details/45310941

 

posted @ 2017-05-19 15:45  索马里猫  阅读(137)  评论(0编辑  收藏  举报