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
- (void)signDocument;
For actually signing the PDF document using the previously acquired biometric signature
- (void)stampDocument;
For deleting the previously acquired biometric signature
- (void)deleteSignature;
For triggering the end of the process, once the document has been finished
- (void)endProcess;
For going to the next page of the document
- (BOOL) goToNextPage;
For going to the previous page of the document
- (BOOL) goToPreviousPage;
For going to the first page of the document
- (BOOL) goToFirstPage;;
For going to the last page of the document
- (BOOL) goToLastPage;
For zoom in the document
- (void) zoomIn;
For zoom out the document
- (void) zoomOut;
For saving changes on an editable document
- (void)saveForms;
Internationalization
Adding geolocation to signatures
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
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
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
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.