Get the User's Location
Using the Java SDK
Get the User's Location (back to all tutorials)
Once your application has the identifier of a Veriplace user, your application needs to obtain permission to locate this user.
This tutorial shows how to use the Get Location API to obtain an opt-in by redirecting the user to the Veriplace Privacy Manager.
-
Step 1: Redirect to Veriplace
Your application specifies a callback URL and redirects the current user to Veriplace, where they will be prompted to opt-in to your application:
-
Step 2: Handle callback
Subsequently, Veriplace redirects the user back to the specified callback URL. As long as you have configured a Servlet to handle this URL, you can check that the current request is a callback and query for the returned location:
Obtaining a user's location can take up to a few minutes. The Veriplace web framework provides a simple way to show the user an interstitial waiting page while waiting for location.
If the user does not opt-in to your application, you will get an exception when trying to get the access token.
If the user's position cannot be determined for some reason, you will get an exception when trying to get location.
Access tokens for the Get Location API can often be reused; however if you attempt to reuse an access token that has been revoked, you will get an exception when trying to get location.
-
Step 3: Done
Congratulations! You're ready to write a Veriplace application.