Consent Handling
Consent Status
Section titled “Consent Status”You can check the current consent status by calling:
spConsentEngine.getConsentStatus("YOUR_APPLICATION_ID")
Consent States
Section titled “Consent States”The SDK supports three consent states:
- Collected: Consent has already been obtained.
- Pending: Consent needs to be collected.
- UpdateRequired: Consent needs to be re-collected.
Check if User has Enabled the Package
Section titled “Check if User has Enabled the Package”To check if a specific package has been marked as enabled by the user upon giving consent, you can call:
val result = spConsentEngine?.getPackage(packageId, "YOUR_APPLICATION_ID")val pkg = result?.dataif(pkg!=null && pkg.isEnabled){ //enable features}
This would return a SPDataMessage containing the SPMobilePackage only if the user has consented. Otherwise, it would return null.
Collecting Consent
Section titled “Collecting Consent”To launch the consent collection popup, use the following method:
ConsentBanner.show(activity);
This popup will inform users about the SDK and provide them with options to agree to all or deny consent. Additionally, you can call the following method to display the secondary consent banner:
ConsentBanner.showSecondary(activity);

Customization Options
Section titled “Customization Options”The consent banner supports customization options and displays a “Customize” button that allows users to adjust their consent preferences. When they click the customization button, they will be directed to the Preference Center, where they can:
- View a list of frameworks and their services.
- Enable or disable consent for specific services.
To display the Preference Center directly, simply start the Preference Center activity:
SPPreferenceCenter.show(context, applicationId)
Declaring SPPreferenceCenter activity in the Manifest
Section titled “Declaring SPPreferenceCenter activity in the Manifest”To properly use the Preference Center Activity, you need to declare it in your app’s AndroidManifest.xml
file. Add the following line inside the <application>
tag:
<activity android:name="ai.secureprivacy.mobileconsent.ui.preference_center.SPPreferenceCenter" android:theme="@style/Theme.SecurePrivacyMobile"/>
This ensures that the SDK’s Preference Center activity is registered and can be accessed correctly.
Essential Services
Section titled “Essential Services”You can mark certain services as essential. These services will not be optional for the user to deny, ensuring compliance with the app’s required functionalities.
Privacy and Cookie Policy
Section titled “Privacy and Cookie Policy”The Preferences screen also includes tabs showcasing content related to the app’s privacy and cookie policies. This ensures users have access to essential information regarding their data handling.
Data Requests
Section titled “Data Requests”Users can submit a request for their data by filling out a form in the Request Data section. This feature helps manage user data requests in compliance with privacy regulations.