# Consent

As a publisher, you should implement a user consent flow either manually or using a Consent Management Platform (CMP) and request for vendor and purpose consents as outlined in IAB Europe’s Mobile In-App CMP API v2.0: Transparency & Consent Framework.

## Enabling the Consent Flow support

To ensure that the SDK support the handling of user-consent preferences when a IAB-compatible CMP library is present, you must enable the feature through the ProximitySDK.enabledCmp() static method or the com.jointag.proximity.CMP\_ENABLED meta-data in your AndroidManifest.xml file.

{% hint style="danger" %}
If you are following the Manual Initialization procedure, this method must be called before calling the library init method to guarantee an error-free process.
{% endhint %}

### Using a Consent Management Platform (CMP)

You can either use [Next CMP](https://wiki.next14.com/one-consent/), or a third-party [TCF compliant CMP](https://iabeurope.eu/cmp-list/).&#x20;

When configuring a third-party CMP to use with the Jointag Proximity SDK, the following requirements must be met:

* Enabling Next Media IAB VendorId 568
* Introducing a custom publisher purpose for Push Notification. The custom publisher purpose must be the first custom purpose (ID => 0)

#### Required Consents

In order for Proximity SDK to start the following consents are required:

* **Profiling** (Base) -> Collect information to build a profile. Purpose \[1]
* **Monitoring** (GeoTracking) -> Allows the SDK to collect information on user visited locations. Purpose \[1, 3], special feature \[1]
* **Advertising** -> Allows the SDK to show advertising content to the user. Purpose \[1,2,3,4,7], special feature \[1], custom purpose \[1]
* **AdvancedTracking** (ScanDevice) -> Allows the SDK to collect information on other APPs installed on the phone - available only on Android. Purpose \[1,3,7,10], special feature \[2], custom purpose \[2]<br>

### Implementing a Custom Consent Flow

If you need to handle the user consent flow manually without the use of a IAB-compatible CMP library, or if the CMP you are using do not allow the customization of custom publisher purpose, it is possible to do so by implementing an in-app consent screen and interacting with the SDK using the following methods:

If you need to handle the user consent flow manually without the use of a IAB-compatible CMP library, or if the CMP you are using do not allow the customization of custom publisher purpose, it is possible to do so by implementing an in-app consent screen and interacting with the SDK using the following methods:

```
// Retrieve or update the manual user profiling consent
ProximitySDK.getInstance().getManualConsent(ManualConsent.Profiling);
ProximitySDK.getInstance().setManualConsent(ManualConsent.Profiling, true);

// Retrieve or update the manual user monitoring consent
ProximitySDK.getInstance().getManualConsent(ManualConsent.Monitoring);
ProximitySDK.getInstance().setManualConsent(ManualConsent.Monitoring, true);

// Retrieve or update the manual user advertising consent
ProximitySDK.getInstance().getManualConsent(ManualConsent.Advertising);
ProximitySDK.getInstance().setManualConsent(ManualConsent.Advertising, true);

// Retrieve or update the manual user advanced tracking consent
ProximitySDK.getInstance().getManualConsent(ManualConsent.AdvancedTracking);
ProximitySDK.getInstance().setManualConsent(ManualConsent.AdvancedTracking, true);
```

{% hint style="warning" %}
When the **manual consent** method is used in the presence of a CMP library, the choices made using the above methods **take precedence** over the choices made by the user in the CMP library screen.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.next14.com/proximity-sdk/consent.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
