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,
    Map<String, Object> templatePlaceholders,
    String languageCode
);
ParameterTypeRequiredDescription
clickwrapTemplateIdStringYesTemplate ID from the dashboard
endUserIdStringYesYour identifier for the end user (max 256 chars)
templatePlaceholdersMap<String, Object>NoKey-value pairs for placeholder substitution
languageCodeStringNoLanguage code (e.g., "en")
Example:
Map<String, Object> placeholders = new HashMap<>();
placeholders.put("fullName", "Alice Example");
placeholders.put("email", "[email protected]");
placeholders.put("company", "Acme Corp");

ClickwrapTemplate request = new ClickwrapTemplate(
    "YOUR_TEMPLATE_ID", endUserId, placeholders, "en"
);

ClicktermDialog.show(this, request, null,
    new ClicktermDialog.OnAgreementResultListener() {
        @Override
        public void onSuccess(String clicktermSignature) {
            if (clicktermSignature == null) {
                Log.i("Clickterm", "User already accepted.");
            } else {
                // Send Signature to your backend for verification
                Log.i("Clickterm", clicktermSignature);
            }
        }

        @Override
        public void onError(String message) {
            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.