Tag: GPS

iOS GPS追踪应用程序,一直运行

我试图做一个应用程序来跟踪用户的GPS,这个应用程序是一种汽车GPS跟踪器,一直获取驱动程序的位置,并将其发送到服务器。 我曾尝试将“位置更新”添加到“背景模式”,但应用程序在进入后台10分钟后会自动挂起。 有没有办法让这个应用程序一直运行,并获得GPS位置? 谢谢。

从iPhone中的相机返回的图像中读取GPS数据

我需要获取iOS设备摄像头拍摄图像的GPS坐标。 我不关心相机胶卷图像,只是使用UIImagePickerControllerSourceTypeCamera拍摄的图像。 我读过很多的stackoverflow的答案,像从UIImage的获取Exif数据 – UIImagePickerController ,要么假定您正在使用的AssetsLibrary框架,似乎不工作的相机图像,或使用CoreLocaiton从应用程序的纬度/经度本身,而不是从形象。 使用CoreLocation 不是一个选项 。 当按下快门button时,不会给我坐标。 (使用基于CoreLocation的解决scheme,您需要在启动摄像头视图之前或之后logging坐标,当然如果设备正在移动,坐标将是错误的,这种方法应该与固定设备配合使用。 我只是iOS5,所以我不需要支持较旧的设备。 这也是一个商业产品,所以我不能使用http://code.google.com/p/iphone-exif/ 。 那么,我有什么select从iOS5中的相机返回的图像读取GPS数据? 我现在所能想到的只是将图像保存到相机胶卷,然后使用AssetsLibrary,但似乎很麻烦。 谢谢! 这是我根据Caleb的回答写的代码。 UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; NSData *jpeg = UIImageJPEGRepresentation(image,1.0); CGImageSourceRef source ; source = CGImageSourceCreateWithData((__bridge CFDataRef)jpeg, NULL); NSDictionary *metadataNew = (__bridge NSDictionary *) CGImageSourceCopyPropertiesAtIndex(source,0,NULL); NSLog(@"%@",metadataNew); 我的控制台显示: 2012-04-26 14:15:37:137 ferret[2060:1799] { ColorModel = RGB; Depth = 8; Orientation […]

有没有办法检查iOS设备是否locking/解锁?

我在我的应用程序中使用了GPS位置更新。 我想检测iOS设备是否处于睡眠模式,以便closuresGPS位置更新并优化电池使用。 我已经尝试在iOS 6暂停位置更新,但它不能按需要工作。 一旦设备进入睡眠模式,我想closuresGPS位置更新。 我想检测设备中的locking/解锁事件。 有什么办法可以实现这个function吗? 到目前为止,我得到了下面给出的达尔文通知 -(void)registerForall { //Screen lock notifications CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), //center NULL, // observer displayStatusChanged, // callback CFSTR("com.apple.iokit.hid.displayStatus"), // event name NULL, // object CFNotificationSuspensionBehaviorDeliverImmediately); CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), //center NULL, // observer displayStatusChanged, // callback CFSTR("com.apple.springboard.lockstate"), // event name NULL, // object CFNotificationSuspensionBehaviorDeliverImmediately); CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), //center NULL, // observer displayStatusChanged, // callback CFSTR("com.apple.springboard.hasBlankedScreen"), // […]

iOS:应用程序在安装应用程序时不会询问用户的权限。 每次都得到kCLAuthorizationStatusNotDetermined – Objective-c&Swift

我正在尝试在iOS应用程序中获取用户位置。 我首先在我的项目中包含了corelocation框架。 然后在一个button上单击我调用核心位置API如下。 当我试图在设备中安装时,核心位置永远不会请求用户权限。 当我尝试获取button单击位置时,我得到kCLAuthorizationStatusNotDetermined作为authorisationStatus。 请帮助我。 我不知道发生了什么事。 – (IBAction)fetchLessAccurateLocation:(id)sender { [self.txtLocation setText:@""]; locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyKilometer; locationManager.distanceFilter = 1000; if ([self shouldFetchUserLocation]) { [locationManager startUpdatingLocation]; } } 这是我的shouldFetchUserLocation方法: -(BOOL)shouldFetchUserLocation{ BOOL shouldFetchLocation= NO; if ([CLLocationManager locationServicesEnabled]) { switch ([CLLocationManager authorizationStatus]) { case kCLAuthorizationStatusAuthorized: shouldFetchLocation= YES; break; case kCLAuthorizationStatusDenied: { […]

是否有可能使用核心位置/ GPS没有任何互联网连接/禁用蜂窝networking?

我需要在没有互联网的地区(例如帆船或撒哈拉沙漠)捕捉GPS 坐标 (不需要反向地理编码,名称等),以便获取您所在地的经纬度。 核心位置是否支持这一点,并回落到全球定位系统(没有细胞三angular测量或WiFi位置映射)? 我想是的,但只是想确定。