SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2014
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a way to detect whether a user has already given permission for geolocation

    Is there a way to detect whether a user has already given permission to use navigator.geolocation?

    I can use localStorage, but the problem is in case the user clears location setting from browser. In this case user still gets true from local storage even though location settings are cleared.

  2. #2
    SitePoint Wizard bronze trophy chris.upjohn's Avatar
    Join Date
    Apr 2010
    Location
    Melbourne, AU
    Posts
    2,197
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    At this point in time the API doesn't have that functionality, if you have a backend language such as PHP + MySQL then the other option would be to store the users choice within a database table but it really wouldn't be worth the headache in my opinion.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •