# Geofencing
Page contents
# About geofencing
Our geofencing feature enables you to strengthen security for transactions by evaluating the current location of a device against a list of allowed regions. By limiting the use of Encap SCA activations (registrations/enrolments) and authentications to certain regions, you can reduce the chance of fraud.
# How does geofencing work?
When geofencing is enabled, the client will send the country code of the location of the device to the server. The server will verify the location and limit the use of the device based on the configuration in your application configuration and what you have set as your allowed regions.
# Supported operations
Geofencing is supported in activation (registration/enrolment) and authentication operations.
Method/operation name | Mode parameter used to configure geofencing | Is geofencing result sent in OPTIONAL mode? |
---|---|---|
startActivation ,finishActivation | GEOFENCING_ACTIVATION_MODE | Yes |
startRecovery ,finishRecovery | GEOFENCING_ACTIVATION_MODE | No |
startAuthentication ,finishAuthentication | GEOFENCING_AUTHENTICATION_MODE | Yes |
startAddOrUpdate ,finishAddOrUpdate | GEOFENCING_AUTHENTICATION_MODE | Yes |
Receiving the geofencing result
The geofencing result is returned from the Encap server to you via the REST API.
# Functionality
Geofencing is configured in your application configuration, through the following mode parameters:
GEOFENCING_ACTIVATION_MODE
GEOFENCING_AUTHENTICATION_MODE
The mode that geofencing is set to determines the functionality when the app calls the methods illustrated in the table above.
# For start methods
The Encap server informs the client about the current geofencing mode.
If geofencing is enabled (OPTIONAL
or REQUIRED
), then the external geocoder platform is called with location as a parameter.
# For finish methods
If geofencing is enabled (OPTIONAL
or REQUIRED
), then the client will send a request to the server that includes the country code from the geocoder external service, or without a country code if the lookup was not successful.
If there is no location on the device, then the client will wait until the timeout measured from the start method to complete.
The timeout is configured on the server for location and geofencing.
# How to configure geofencing
To use our geofencing feature, you need to:
# Configure the mobile SDK
To configure the mobile SDK for geofencing:
You need to insert location permissions into the app manifest. To do this, see the enable location section in our location feature documentation.
The end-user must grant location permissions on their mobile device.
# Configure the application configuration
The process for configuring the application configuration varies depending on whether you are a MobileID customer or an Encap SCA customer.
You can use the buttons below to learn how to configure the application configuration for the different products.
# Error codes
If the geofencing mode is set to
OFF
orOPTIONAL
, then no new error codes are introduced.If the geofencing mode is set to
REQUIRED
, then it is possible to receive one of the errors illustrated in the table below from a finish method call.
You can find the corresponding error descriptions in our SDK error codes documentation.
Error code | Error name |
---|---|
270 | serverErrorGeofencingBoundaryValidationFailed |
271 | serverErrorGeofencingClientFailure |