How to keep GPS app running in background without pauses

给你一囗甜甜゛ 提交于 2019-11-30 10:39:45

In your info plist, add Required background modes

and set one item to App registers for location updates

Updated:

As ios return to - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation when there is a significant distance change. I guess you need to change:

// Set the movement threshold.
locationManager.distanceFilter = 500; // meters

inside a building you will often not get any GPS location. GPS needs free view to sky. If you dont get a position, of course the only reason to keep your app running in background is missing, therefore ios puts your App inactive till you get your next GPS location (near the window,or outside)

Further you stop gps when you. in background, [self stopGPS] why? let it alive!

If you are using a phone instead of GPS you can use Network for location services. locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 300, 5, konumDinleyicisiNetwork);

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!