Skip to content

  • Documentation
    • Web App – OKdokument API
    • Signatus Mobile App
  • Contact Us

Integration – App-to-App

  • Introduction
  • How does it work?
  • START-ACTIVITY-FOR-RESULT (APP – SIGNATUS – APP)
  • Sending data to Master Wizard via Intent
  • Runtime Configuration Parameters (Display, Fields, Signing Process)
View Categories
  • Home
  • Documentation
  • Signatus Mobile App
  • Integration – App-to-App
  • START-ACTIVITY-FOR-RESULT (APP – SIGNATUS – APP)

START-ACTIVITY-FOR-RESULT (APP – SIGNATUS – APP)

Send the document or data from the originating app to SIGNATUS and expect SIGNATUS to send an info via a result call-back to the originating app, where work with signed document can continue.
Step-by-step:

  1. Copy a PDF to your app’s private storage.
  2. Expose the file via a FileProvider.
  3. Launch SIGNATUS with the Intent below.
  4. Handle the result in ActivityResultLauncher.

Call from originating Application to SIGNATUS:

  1. After the document is signed in SIGNATUS, the user is automatically returned to the originating application.
  2. The PDF file remains in the internal storage of originating application throughout the entire process. Once the document is signed, SIGNATUS replaces the original PDF with the signed version.

Integration steps #

1) File-paths descriptor
Create a file_paths.xml descriptor in res/xml

<paths>
	<files-path name="pdf_data" path="pdf/"/>
</paths>


2) Declare FileProvider in AndroidManifest.xml:

<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="com.app2app.anasoft.pdfprovider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths" />
</provider>


3) Save the PDF document in the internal storage directory according to the configuration done in section 1:

File pdf = new File(getFilesDir()+ "/pdf/Contract123.pdf ");

4) Launch SIGNATUS via intent:
Signatus replaces the original PDF with the signed version of the PDF

  private void signPdf(File pdf, @Nullable JSONObject data) {
      Log.d("App2App", "Pdf path  :" + pdf.getPath());
      Uri pdfUri = FileProvider.getUriForFile(this, "com.app2app.anasoft.pdfprovider", pdf);
      Log.d("App2App", "Pdf uri  :" + pdfUri);
      Intent intent = new Intent();
      intent.setAction("com.anasoft.signatus.signDocument");
      intent.setDataAndType(pdfUri, "application/pdf");
      if (data != null) {
          intent.putExtra("data", data.toString());
      }
      intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
      signLauncher.launch(intent);
  }

5) Handle the result using ActivityResultLauncher:

ActivityResultLauncher<Intent> signLauncher = registerForActivityResult(new ActivityResultContracts.StartActivityForResult(),
        result -> {
            Log.d("App2App", "Result code :" + result.getResultCode());
            Log.d("App2App", "Result data :" + result.getData());
        });

Data parameter #

The optional data parameter in the sign intent provides a mechanism to configure aspects of the user interface and modify application behavior

Data example :

{
	"color": "#230090",
	"config": {
		"signerInfo": {
			"SC_signature": [
				"John Smith"
			]
		},
		"method": "write"
	},
	"allowedFields": {
		"SIGNATURE": [
			"SC_signature"
		],
		"TEXT": [
			"TO_text",
			"TC_text"
		]
	},
	"allowedButtons": [
		"action_ok",
		"action_canceled"
	],
	"nativeMenu": [
		{
			"id": "action_ok",
			"title": "SAVE AND CLOSE",
			"color": "#ffffff"
		},
		{
			"id": "action_canceled",
			"title": "CANCEL",
			"icon": "REMOVE",
			"color": "#ff0000"
		}
	]
}

Data description :

NameValueDescription
colorHexadecimal color codeToolbar color
configJSON ObjectAdditional signature field configuration
config.signerInfoJSON ObjectAssigning the signer’s name to a signature field. Signer name will appear within the signature.
config.signerInfo.keyStringAcrofield name
config.signerInfo.valueStringSigner name
config.methodStringSpecifies the required user interaction with the document. Allowed values :
– read : mandatory to read the document and scroll all the way down to the bottom of the document
– write : mandatory to sign
– optional : optional to read
Default : write
allowedFieldsJSON ObjectConfiguration of which AcroFields will be allowed during signing.
allowedFields.keyStringAcrofield type. Allowed values :
– TEXT
– CHECKBOX
– SIGNATURE
– RADIO
– COMBOBOX
allowedFields.valueJSON ArrayAcroField names
allowedButtonsJSON ArrayToolbar native button IDs that will be displayed. Allowed values:
– action_ok
– action_discard
– action_canceled
– action_up
– action_down
nativeMenuJSON ArrayToolbar native buttons configuration
nativeMenu.idStringButton id. Allowed values:
– action_ok
– action_discard
– action_canceled
– action_up
– action_down
nativeMenu.titleStringButton text
nativeMenu.colorHexadecimal color codeButton text color
nativeMenu.iconREMOVEIf “REMOVE” is set, button icon will not be displayed.

Data example result :

Updated on 29/07/2025
How does it work?Sending data to Master Wizard via Intent
Table of Contents
  • Integration steps
  • Data parameter
  • Documentation
    • Web App – OKdokument API
    • Signatus Mobile App
  • Contact Us
Proudly powered by WordPress