Skip to main content

Geolocation

MobbSign can add the location of the device to every signature, as additional evidence of where the document was signed. The location is included in the encrypted signature data and as fields of the signature that can be reviewed later:

FieldDescription
Latitude and longitudeCoordinates of the device.
AccuracyAccuracy of the location, in metres.
Locality and countryName of the locality and of the country.
Country codeISO code of the country.

1. Declare the permissions​

AndroidManifest.xml
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Request the location permission at runtime before the user signs.

2. Enable geolocation​

Bundle customizationBundle = new Bundle();
customizationBundle.putBoolean(MobbSignCustomizationProperties.DEVICE_POSITION_ENABLED, true);
mobbSignView = new MobbSignView(this, customizationBundle);
PropertyDescription
DEVICE_POSITION_ENABLEDAdds the location of the device to the signatures.
DEVICE_POSITION_LAST_TIMEMaximum age of the location for it to be included.
DEVICE_POSITION_ACCURACYMinimum accuracy of the location for it to be included.

If the location cannot be obtained and SHOW_RELEVANT_MESSAGES is enabled, the user is informed.