Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

IOS Wait for player to get allow or deny acesse to the GPS.

Discussion in 'Scripting' started by PulseHunter, Aug 14, 2015.

  1. PulseHunter

    PulseHunter

    Joined:
    Jul 31, 2013
    Posts:
    23
    Hi,

    what is the best way to detect when a player have pressed allow or deny for the GPS signal. ?

    I have tried something like this :
    Code (CSharp):
    1. if (loc.isEnabledByUser)
    2.         {
    3.             StartCoroutine("ShowLoading");
    4.             StartCoroutine("Loading");
    5.         }
    But the app/game crash on the first startup(after player have allowed or Denyed).

    I dont know if it is "taking" too long or because it try to acesss the GPS pos to fast.

    After first startup does it store last position ?

    //Michael