Location Settings

I am currently trying to build an app for employees to clock on and off from work each day.

I have currently setup geolocation to automatically get the location of the user and store it in the knack app however for obvious reasons if a user presses deny it cannot get the location.

Is there a way I can force location to be on for the page that the clock on / off is on?

Hi Andy,

With custom code, you could implement the following workaround:

  1. When the page renders, check if their location is enabled.
  2. If location is disabled, hide the page and show a message to the user instructing them that allowing location is necessary to proceed.
  3. Alternatively, if having the exact location isn’t critical, you can estimate the user’s location using an “IP Geolocation API” which gives you location at the city-level. Store the result in your database.

Hope this helps!

Ian
Knack Pros

1 Like