Configuration
License
The license key is bound to the bundle identifier of your app. The SDK validates it online the first time it is used and every time it expires and is renewed.
[self.mobbSignView configureLicense:licenseKey status:^(MobbSignLicenseResult result, NSDate *expirationDate) {
switch (result) {
case MobbSignLicenseResult_VALID:
break;
case MobbSignLicenseResult_GRACE_PERIOD:
// Valid for a limited time: renew the license
break;
case MobbSignLicenseResult_EXPIRED:
case MobbSignLicenseResult_NOT_VALID:
case MobbSignLicenseResult_DEVICES_EXCEEDED:
// Documents can be viewed, but not signed
break;
default:
break;
}
}];
| Result | Meaning |
|---|---|
MobbSignLicenseResult_VALID | The license is valid. expirationDate is its expiry date. |
MobbSignLicenseResult_GRACE_PERIOD | The license could not be validated, but the SDK keeps working during a grace period of 30 days. |
MobbSignLicenseResult_EXPIRED | The license has expired. |
MobbSignLicenseResult_NOT_VALID | The license is not valid for this app. |
MobbSignLicenseResult_DEVICES_EXCEEDED | The license has reached its maximum number of devices. |
To sign with an electronic seal through MobbSign Server, initialise the SDK with initAPI instead of configureLicense. See Signature with electronic seal.
Encryption key
setEncryptionKey: receives the path of the public key that encrypts the biometric data of every signature. Without it, documents cannot be signed.
Events
| Block | Called when |
|---|---|
onDocumentShown | The document has been loaded and shown. It receives editable: YES if the document contains form fields. |
onSignButtonPressed | The user taps Sign. |
onSignatureAcquised | The user has drawn a signature, before it is confirmed. |
onSignatureDeleted | The user has deleted the signature drawn. |
onDocumentSigned | A signature has been added to the document. |
onBackButtonPressed | The user taps Back. |
onProcessEnd | The user has finished. It receives the signed document. |
onErrorOccurred | An error has occurred. It receives the error code. |
onActivePenStatusChanged | The connection status of the active pen has changed. |
onLocationRetrieved | The location of the device has been obtained, or could not be. |
onDocumentSigned receives the details of the signature just added:
| Parameter | Description |
|---|---|
signedDocument | The signed document. |
encryptedSignatureData | The encrypted signature data: biometric data, document hash and the rest of the signature information. |
signatureImage | The image of the signature. |
signaturePage | The page where the signature has been placed. |
signatureCoord | The coordinates of the signature on the page. |
Load a document
// From a file path
- (void)loadPDFDocument:(NSString *)path name:(NSString *)name;
// From a file path, filling in the form fields
- (void)loadPDFDocument:(NSString *)path name:(NSString *)name fields:(NSDictionary *)fields;
// From data
- (void)loadPDFDocumentFromData:(NSData *)documentData name:(NSString *)name;
// From data, filling in the form fields
- (void)loadPDFDocumentFromData:(NSData *)documentData name:(NSString *)name fields:(NSDictionary *)fields;
Customisation dictionary
The dictionary passed to initWithFrame:customizationDictionary: configures the behaviour and appearance of the view. The keys are constants such as kMobbSign_SIGNATURE_STROKE_COLOR; the documentation included in the distribution lists them all. The guides describe the keys of each feature:
| Area | Keys | Guide |
|---|---|---|
| Geolocation | kMobbSign_DEVICE_ENABLED, kMobbSign_DEVICE_LAST_TIME, kMobbSign_DEVICE_POSITION_ACCURACY | Geolocation |
| Active pens | ACTIVEPEN_ENABLED, ACTIVEPEN_TYPE | Active pens |