Skip to main content

Events

Each listener is registered with a method of MobbSignAPI that receives two callbacks: successCallback, called every time the event occurs, and failureCallback, called if the listener cannot be registered.

MethodEvent
setOnDocumentShownListenerThe document has been shown. The callback receives {editable}: true if the document contains form fields.
setOnSignButtonPressedListenerThe user taps Sign.
setOnSignatureAcquiredListenerThe user has drawn a signature, before it is confirmed.
setOnSignatureDeletedListenerThe user has deleted the signature drawn.
setOnDocumentSignedListenerA signature has been added to the document. The callback receives the signature result.
setOnBackButtonPressedListenerThe user taps Back.
setOnProcessEndListenerThe signing process has ended.
setOnErrorOccurredListenerAn error has occurred. The callback receives the error code and its message.

Document signed​

The callback of setOnDocumentSignedListener receives an object with:

PropertyDescription
documentThe signed document, base64-encoded.
encryptedSignatureDataThe encrypted signature data, base64-encoded.
signatureBitmapThe image of the signature, base64-encoded.
signaturePageThe page of the signature.
signatureCoordThe coordinates of the signature on the page.
MobbSignAPI.setOnDocumentSignedListener(({document, signaturePage}) => {
console.log(`Signed on page ${signaturePage}`);
uploadToBackend(document);
}, console.error);