我正在使用核心定位框架。是否可以伪造当前位置以用于社交网络应用程序?如果是,那怎么办?
请帮忙。
先感谢您。
:: 已编辑 ::
在浏览了更多内容后,我为此编写了代码,它可能会使用 CLLocationManager 类的重写方法进行更改。像下面这样的代码:
@interface MyHeading : CLHeading
-(CLLocationDirection) newHeading;
-(CLLocationDirection) new1Heading;
@end
@implementation MyHeading
-(CLLocationDirection) newHeading { return 55; }
-(CLLocationDirection) new1Heading { return 56; }
@end
@implementation CLLocationManager (LF)
- (void)setFLocation {
CLLocation *location = [[CLLocation alloc] initWithLatitude:40.778023 longitude:-73.981935];
[[self delegate] locationManager:self didUpdateToLocation:location fromLocation:nil];
id heading = [[MyHeading alloc] init];
[[self delegate] locationManager:self didUpdateHeading: heading];
}
-(void)startUpdatingHeading {
[self performSelector:@selector(setFLocation) withObject:nil afterDelay:0.1];
}
- (void)startUpdatingLocation {
[self performSelector:@selector(setFLocation) withObject:nil afterDelay:0.1];
}
@end
谢谢大家的分享。再次感谢。