MobbSign Advanced features
Customization
The PDF Viewer can be customizable for adapt it to the look&feel of the client application. You can hide or show the top and bottom bars, change their background colours, etc. using a customization dictionary or class if we talk to Android platform:
For activating the biometric signature acquisition / drawing.
mobbSignView.signDocument()
- (void)signDocument;
public void SignDocument()
For actually signing the PDF document using the previously acquired biometric signature.
mobbSignView.stampDocument()
- (void)stampDocument;
public async Task StampDocument()
For deleting the previously acquired biometric signature.
mobbSignView.deleteSignature()
- (void)deleteSignature;
public void DeleteSignature()
For triggering the end of the process, once the document has been finished.
mobbSignView.endProcess()
- (void)endProcess;
public async void EndProcess()
For going to the next page of the document.
mobbSignView.goToNextPage()
- (BOOL) goToNextPage;
public bool GoToNextPage()
For going to the previous page of the document.
mobbSignView.goToPrevioustPage()
- (BOOL) goToPreviousPage;
public bool GoToPreviousPage()
For going to the first page of the document.
mobbSignView.goToFirstPage()
- (BOOL) goToFirstPage;;
public bool GoToFirstPage()
For going to the last page of the document.
mobbSignView.goToLastPage()
- (BOOL) goToLastPage;
public bool GoToLastPage()
For zoom in the document.
mobbSignView.zoomIn()
- (void) zoomIn;
public void ZoomIn()
For zoom out the document.
mobbSignView.zoomOut()
- (void) zoomOut;
public void ZoomOut()
For saving changes on an editable document.
- (void)saveForms;
public async void SaveForms();
Internationalization
Android
You can customize some texts with your own literals replacing the content value of the following keys in the resource file of your project (res/values/strings.):
<string name="mobbsign_sign">Sign</string>
<string name="mobbsign_back">Back</string>
<string name="mobbsign_save">Save</string>
<string name="mobbsign_confirm">Confirm</string>
<string name="mobbsign_delete">Delete</string>
<string name="mobbsign_send">Send</string>
<string name="mobbsign_finalize">Finalize</string>
<string name="mobbsign_zoom_in">Zoom In</string>
<string name="mobbsign_zoom_out">Zoom Out</string>
<string name="mobbsign_previous">Previous</string>
<string name="mobbsign_next">Next</string>
Adding geolocation to signatures
iOS
MobbSign for iOS supports adding geolocation properties to the signature; location fields are added to the unsigned zone of the signature so it can be reviewed without the private key. Fields included are:
- Latitude
- Longitude
- Accuracy (in meters)
- Locality
- Country
- CountryCode (ISO)
First of all, you have to add location permissions to your app, by editing the Info.plist file of your project and adding these lines:
<key>NSLocationWhenInUseUsageDescription</key>
<string>We need to access your location to sign the document</string>
The string can be changed for anything that explains the user why the permission is needed.
To include location data on the signature you have to add a property to MobbSignView:
NSMutableDictionary * customDict = [[NSMutableDictionary alloc] init];
[customDict setObject:@YES forKey:kMobbSign_DEVICE_ENABLED];
MobbSignView *mobbSignView = [[MobbSignView alloc] initWithFrame:wholeWindow customizationDictionary:customDict];
Additionally you can also configure the minimum accuracy and maximum location time for the location to be included using the kMobbSign_DEVICE_LAST_TIME
and kMobbSign_DEVICE_POSITION_ACCURACY
properties. If any of those conditions are not fulfilled, location data will not be included in the signature.
If you wish to be informed of the location result, you can implement the OnLocationRetrieved
block of MobbSignView.
Using Pogo Connect or JotTouch 4 (iOS only)
MobbSign for iOS supports signing with the finger or a capacitive pen. However in some cases you would like to give your users a better user experience by letting them use some active pen. This will allow them to sign smoother and also to capture real pressure of the signature.
Currently MobbSign supports two of the main active pen models in the market: Pogo Connect and JotTouch 4. Please keep in mind the hardware requirements of each one of them, as they do not support all iOS devices.
In order to use one of them in your application, you should follow these steps:
Add the corresponding extension folder to your project. Along with the .framework and .bundle files, the libs folder of the zip contains also two folders that contain the necessary files to work with Pogo or JotTouch. You just need to add them to your project the same way that you added the framework and bundle files.
Add the other frameworks needed for each extension:
- For Pogo, you must add:
- CoreBluetooth
- AVFoundation
- For JotTouch, you must add:
- CoreBluetooth
- CoreMotion
- For Pogo, you must add:
In order to let the SDK find the extension classes, you would need to add the following snippet to your code somewhere in your application before actually using them (AppDelegate’s didFinishLaunchingWithOptions may be a good choice):
- For Pogo:
#import "PogoPenManager.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [PogoPenManager alloc];
- For JotTouch:
#import "JotTouchPenManager.h" @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [JotTouchPenManager alloc];
Set up your MobbSignView specifying that you want to use an active pen:
- For Pogo:
NSMutableDictionary * customDict = [[NSMutableDictionary alloc] init]; [customDict setObject:[NSNumber numberWithBool:YES] forKey:ACTIVEPEN_ENABLED]; [customDict setObject:[NSNumber numberWithBool:ActivePenTypePogo] forKey:ACTIVEPEN_TYPE]; MobbSignView *mobbSignView = [[MobbSignView alloc] initWithFrame:wholeWindow customizationDictionary:customDict]; …
- For JotTouch:
NSMutableDictionary * customDict = [[NSMutableDictionary alloc] init]; [customDict setObject:[NSNumber numberWithBool:YES] forKey:ACTIVEPEN_ENABLED]; [customDict setObject:[NSNumber numberWithBool:ActivePenTypeJotTouch] forKey:ACTIVEPEN_TYPE]; MobbSignView *mobbSignView = [[MobbSignView alloc] initWithFrame:wholeWindow customizationDictionary:customDict]; …
Using Signature with Certificate Online (iOS only)
MobbSign can sign with certificate your document, to do this, you only must configure the sdk in the following way.
Be sure you are not calling to configureLicense method.
Call the method
initAPI
following these lines.[mobbSignView initAPI:license apiKey:@"<yourApiKey>" appId:@"<yourAppId>" onlineMode:true allowOfflineIfError:true environment:@"test" initAPIStatus:^(MobbSignAPIResult apiResult, MobbSignLicenseResult result, NSDate* expirationDate){ <yourCode> }];
apiKey
. Your api key provided by Mobbeel. Mandatory.appId
. Your app id provided by Mobbeel. Mandatory.onlineMode
. Indicate if you want to start Mobbsign with online mode (including certificate signature) or offline mode (without certificates) and executed in your own device.allowOfflineIfError
. If it is true, avoid stop the application in case some error in API communication happen.environment
. Accept the following strings:test
. To sign against our test server.pro
. To sign against our production server.
initAPIStatus
. The function to execute when initAPI is finished to check results.
Signature verification with MobbID
Android
MobbSign can work together with MobbID to verify the user signature in use cases where it is important to be sure that only the genuine user can sign on the document.
IMPORTANT: This functionality is not present in the standard MobbSign SDK, so if you need to use it, please contact with Mobbeel team to make sure you have the correct SDK with both MobbID and MobbSign in it.
If you want to verify the user signature before actually sign the document, you just need to use two extra parameters on the SignatureConfiguration object for the next signature to be acquired. You just need to specify that the signature will need verification, along with the uuid of the user in MobbID*:
SignatureConfiguration signatureConfiguration = new SignatureConfiguration();
signatureConfiguration.setVerification(true);
signatureConfiguration.setUserId(userId);
mobbSignView.configureNextSignature(signatureConfiguration);
By doing that, when the user tries to confirm their signature, the verification will be performed against the MobbID instance (online or offline, as configured) and the document will only be actually signed if the verification success. If not, an error will be reported using the MobbSignErrorOccurredListener.onErrorOccurred method.
*The way you create a user in MobbID and how you enroll the user signature for subsequents verification is out of the scope of this document. Please refer to MobbID SDK documentation.
iOS
MobbSign can work together with MobbID to verify the user signature in use cases where it is important to be sure that only the genuine user can sign on the document.
The first step is to add the MobbID Extension to your project. The libs-extension folder of the zip contains the necessary files to work with MobbID. You just need to add them to your project the same way that you added the framework and bundle files.
Along with the MobbIDExtension, you will also need to add the following extra frameworks:
- CoreMotion
- AVFoundation
- AssetsLibrary
- CoreMedia
If you want to verify the user signature before actually sign the document, you just need to use two extra parameters on the SignatureConfiguration object for the next signature to be acquired. You just need to specify that the signature will need verification, along with the uuid of the user in MobbID*:
SignatureVerificator *verificator = [[MobbIDSignatureVerificator alloc] init];
mobbSignView.signatureVerificator = verificator;
SignatureConfiguration *signatureConfiguration = [[SignatureConfiguration alloc] init];
[signatureConfiguration setVerification:YES];
[signatureConfiguration setUserId:userId];
[mobbSignView configureNextSignature:signatureConfiguration];
By doing that, when the user tries to confirm their signature, the verification will be performed against the MobbID instance (online or offline, as configured) and the document will only be actually signed if the verification success. If not, an error will be reported using the onErrorOcurred block.
*The way you create a user in MobbID and how you enroll the user signature for subsequents verification is out of the scope of this document. Please refer to MobbID SDK documentation.