Location Works on iPhone 4 & 5 But Not 5s

Discussion in 'iOS Programming' started by oo7ml, Aug 11, 2014.

  1. oo7ml macrumors 6502

    Joined:
    Jan 20, 2010
    #1
    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.
     
  2. JohnsonK macrumors regular

    Joined:
    Mar 6, 2014
    #2
    Core Location works just fine on my 5s.

    Perhaps your friend denied access to his location? Ask him to recheck it
     
  3. oo7ml thread starter macrumors 6502

    Joined:
    Jan 20, 2010
    #3
    Hi, he has granted access to his location... it works fine when the app is open so it wouldn't be a permission problem.
     
  4. ArtOfWarfare macrumors 604

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #4
    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.
     
  5. oo7ml thread starter macrumors 6502

    Joined:
    Jan 20, 2010
    #5
    I didn't know thee was two different permissions, whee are those settings
     
  6. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #6
    Location and Maps Programming Guide: Getting Location Events in the Background (iOS Only)

     
  7. oo7ml thread starter macrumors 6502

    Joined:
    Jan 20, 2010
    #7
    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
     
  8. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #8
    I searched for "ios programming request background app refresh" in Google and found this as the third resource:
    App Programming Guide for iOS: Background Execution
     
  9. oo7ml thread starter macrumors 6502

    Joined:
    Jan 20, 2010
    #9

Share This Page