Search Unity

GPS (input.location) will only run in background

Discussion in 'iOS and tvOS' started by Chrisbii, Nov 2, 2014.

  1. Chrisbii

    Chrisbii

    Joined:
    Oct 28, 2014
    Posts:
    9
    Hi.

    I'am trying to get some GPS data with the script from the input.location documentation.

    I can't use "return" in the coroutine, like in the example, so I am using "yield return 0" instead.

    When I am running the app on my iPhone, the location service is tuned off. If I switch to the "location settings" do I have the choice to turn on the service for my app, but it states that the location service only will run in the background with this app. If i switch to my app again I have the GPS data, but it automatically turns off the service again, and wan't update.

    I can now switch to settings again and turn the GPS in background on, wait and switch to my app again.

    It would be nice to run my app in the foreground and get the data I am requesting :)

    Any ideas?
     
  2. Chrisbii

    Chrisbii

    Joined:
    Oct 28, 2014
    Posts:
    9