Skip to main content
Version: 3.0.x.x RR (iOS)/ 3.0.x.x RR (Android)

Geolocation Aware Main Screen Link

The Access App provides the option of showing a linked text on the apps main screen opening a configurable URL using the default system browser. This main screen link can optionally be made geolocation aware - only being displayed if the device is located to one or more specifiable countries.

An example use case for this feature is a requirement for apps in China: Displaying the ICP (Internet Content Provider) number referencing to the official Chinese government ICP database.

Limitations

The geolocation feature depends on resolving the clients IP address to a geolocation. This imposes some limitations:

  • The clients IP address might not be resolvable to a specific country
  • Usage of a VPN will result in the resolved country being the VPNs termination endpoint instead of the mobile devices location.

Prerequisites

  • Access App version 3.1.0 or newer
  • Nevis backend components version 8.2511.x or newer

This feature is currently not available for the Nevis Authentication Cloud product. Please submit a feature request via the Nevis portal in case you would like to use the feature with the Nevis Authentication Cloud.

Setup and Configuration

Using this feature requires:

  • Providing the main screen link app configuration as part of the Access App order.

    • List of ISO 3166-1 alpha-2 country codes indicating in which countries the main screen link should be displayed.
    • List of URLs hosting the geolocation HTTP API. If more than one URL is provided, the app will use the result of the first service providing a success response. Providing multiple URLs can be useful in case your app is distributed worldwide and you are concerned about networking delays.
    • A timeout value defining how long the app should wait for a reply from a single geolocation service endpoint. The default is 250 milliseconds.
  • Creating an account at https://www.maxmind.com/ and downloading the free geolite2country database.

  • Configuring the Geolocation Service nevisAdmin4 pattern to configure the necessary HTTP API endpoint. Check the configuration to ensure the correct HTTP header configuration is used based on your infrastructure setup.

Testing

You can test the services configuration and availability via simple CURL command. With the default Admin4 pattern settings, the HTTP API will be available at /geoip:

curl -X GET "https://<your-domain>/geoip"
{
"query":"<your-ip>",
"status":"success",
"continentCode":"EU",
"countryCode":"CH",
"licence":"https://www.maxmind.com/en/geolite2/eula"
}

For app-side testing we recommend using a VPN to connect to different locations and observe whether the main screen link is displayed according to your configuration.

IP Address to Geolocation API definition

In case you do not want to use the Nevis HTTP API, you have the option of providing your own or using a different product as you are free to configure any service URL with the Access App.

The requirements for a compatible HTTP API are as follows:

  • HTTP Method GET
  • Response Content-Type application/json
  • HTTP Status Code 200

Response Body

AttributeTypeDescriptionOptional
queryStringClient IP addresstrue
statusStringThe status of the IP address to geolocation resolution. Accepted values are success in case the resolution succeeded or fail otherwise.false
countryCodeStringISO 3166-1 alpha-2 country codefalse
continentCodeStringContinent codetrue
messageStringMessage in case status is failtrue
licenceStringAttribution licencetrue

Optional attributes are ignored by the Access App.