Skip to main content
ClicktermDialog controls the clickwrap consent dialog shown to end users in your Android app.

Methods

show

Displays a clickwrap dialog. If the user has already accepted the latest effective major version, the onSuccess callback fires with a null Signature.
ClicktermDialog.show(
    Activity activity,
    ClickwrapTemplate request,
    JSONObject configOptions,  // nullable
    ClicktermDialog.OnAgreementResultListener listener
);
Parameters:
ParameterTypeDescription
activityActivityThe current Android Activity
requestClickwrapTemplateRequest object with template ID, user ID, placeholders, and language
configOptionsJSONObjectOptional configuration (pass null for defaults)
listenerOnAgreementResultListenerCallback for success/error
ClickwrapTemplate constructor:
new ClickwrapTemplate(
    String clickwrapTemplateId,
    String endUserId,
    TemplatePlaceholdersRequestDto templatePlaceholders,
    String languageCode
);
ParameterTypeRequiredDescription
clickwrapTemplateIdStringYesTemplate ID from the dashboard
endUserIdStringYesYour identifier for the end user (max 256 chars)
templatePlaceholdersTemplatePlaceholdersRequestDtoNoStructured placeholder object with standard fields plus customPlaceholders
languageCodeStringNoLanguage code (e.g., "en")
Example:
val placeholders = TemplatePlaceholdersRequestDto(
    fullName = "Alice Example",
    email = "[email protected]",
    company = "Acme Corp",
    customPlaceholders = mapOf(
        "region" to "EMEA",
    ),
)

val request = ClickwrapTemplate(
    "YOUR_TEMPLATE_ID", endUserId, placeholders, "en"
)

ClicktermDialog.show(this, request, null,
    object : ClicktermDialog.OnAgreementResultListener {
        override fun onSuccess(clicktermSignature: String?) {
            if (clicktermSignature == null) {
                Log.i("Clickterm", "User already accepted.")
            } else {
                // Send Signature to your backend for verification
                Log.i("Clickterm", clicktermSignature)
            }
        }

        override fun onError(message: String) {
            Log.e("Clickterm", message)
        }
    }
)

showAcceptedContent

Displays the previously accepted clickwrap content.
ClicktermDialog.showAcceptedContent(
    Activity activity,
    ClickwrapAcceptedAgreementRequest request,
    ClicktermDialog.OnAcceptedContentListener listener
);
Example:
ClickwrapAcceptedAgreementRequest request =
    new ClickwrapAcceptedAgreementRequest(templateId, endUserId, "en");

ClicktermDialog.showAcceptedContent(this, request,
    new ClicktermDialog.OnAcceptedContentListener() {
        @Override
        public void onSuccess(ClickwrapTemplateContent content) {
            Log.i("Clickterm", content.getContent());
        }

        @Override
        public void onError(String message) {
            Log.e("Clickterm", message);
        }
    }
);
Only works if the user has an accepted and verified event for this template.