Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

oo7ml

macrumors 6502
Original poster
Jan 20, 2010
259
0
Hi,

One of my apps contains a very small and simple tracker, which basically updates the user's live position to the DB every 5 seconds, and then their friend can see this on their device.

It has been working fine for all of my users apart from one user, who is using an iPhone 5s. It works fine for him when he has the app open on the screen BUT when he minimises the app, the app no longer updates his position in the DB.

All of the other users and devices work fine in the background.

Has anyone ever come across this before? Thanks in advance for your help.
 
Core Location works just fine on my 5s.

Perhaps your friend denied access to his location? Ask him to recheck it
 
Hi, he has granted access to his location... it works fine when the app is open so it wouldn't be a permission problem.
 
Hi, he has granted access to his location... it works fine when the app is open so it wouldn't be a permission problem.

Perhaps I'm mistaken, but I thought it was required that users give permission for both:
1 - Location to be used by the app in the foreground.
2 - Location to be used by apps in the background.

I think it's two seperate permissions that are required. IE, I have Google Maps set to use my location when it's in the foreground, but not when it's in the background.
 
I didn't know thee was two different permissions, whee are those settings
 
Location and Maps Programming Guide: Getting Location Events in the Background (iOS Only)

Important: A user can explicitly disable background capabilities for any app. If a user disables Background App Refresh in the Settings app—either globally for all apps or for your app in particular—your app is prevented from using any location services in the background. You can determine whether your app can process location updates in the background by checking the value of the backgroundRefreshStatus property of the UIApplication class.
 

Thanks Dejo, i've figured it out.

Location Serivices (settings) are under Privacy... however, Background App Refresh (settings) are under General.

His settings was off for all apps. He only got the phone weeks ago and is adamant that he did not touch this setting (he never even knew it existed)

Is there a way that you can specifically turn on Background Refresh for your app, similar to the way you ask the user for other permissions.

I've read through the doc below, but i can't seem to find anything that would indicate that you could do it.

https://developer.apple.com/library....html#//apple_ref/doc/uid/TP40009497-CH2-SW10
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.