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 fields are added to the unsigned area of the signature, so they can be reviewed without the private key:

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 usage description​

Add the usage description to Info.plist. iOS shows it when it asks the user for permission:

Info.plist
<key>NSLocationWhenInUseUsageDescription</key>
<string>Your location is added to the signature as evidence of where the document was signed.</string>

2. Enable geolocation​

NSMutableDictionary *customDict = [[NSMutableDictionary alloc] init];
[customDict setObject:@YES forKey:kMobbSign_DEVICE_ENABLED];
self.mobbSignView = [[MobbSignView alloc] initWithFrame:self.view.bounds customizationDictionary:customDict];
KeyDescription
kMobbSign_DEVICE_ENABLEDAdds the location of the device to the signatures.
kMobbSign_DEVICE_LAST_TIMEMaximum age of the location for it to be included.
kMobbSign_DEVICE_POSITION_ACCURACYMinimum accuracy of the location for it to be included.

If a condition is not met, the location is not included in the signature. The onLocationRetrieved block receives the result of each location request.