# Deprecated

## User Status

## getDisabledPurposes

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
The result of this method has been replaced by `getUserStatus().purposes.consent.disabled`.
{% endhint %}

## getDisabledPurposeIds

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
The result of this method has been replaced by `getUserStatus().purposes.consent.disabled`.
{% endhint %}

## getDisabledVendors

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
The result of this method has been replaced by `getUserStatus().vendors.consent.disabled`.
{% endhint %}

## getDisabledVendorIds

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
The result of this method has been replaced by `getUserStatus().vendors.consent.disabled`.
{% endhint %}

## getEnabledPurposes

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
The result of this method has been replaced by `getUserStatus().purposes.global.enabled`.
{% endhint %}

## getEnabledPurposeIds

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
The result of this method has been replaced by `getUserStatus().purposes.global.enabled`.
{% endhint %}

## getEnabledVendors

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
The result of this method has been replaced by `getUserStatus().vendors.consent.enabled`.
{% endhint %}

## getEnabledVendorIds

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
The result of this method has been replaced by `getUserStatus().vendors.consent.enabled`.
{% endhint %}

## getUserConsentStatusForPurpose

**Deprecated**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
Search the purposeId in `getUserStatus().purposes.consent.enabled` or `getUserStatus().purposes.consent.disabled`.
{% endhint %}

Get the user consent status for a given purpose. You must also check that the user has given consent to a vendor before being able to load a vendor.

**Parameters**

| Name      | Type   | Description                                         |
| --------- | ------ | --------------------------------------------------- |
| purposeId | string | The ID of the purpose to check the user consent for |

**Returns**

A `Promise<boolean>` that indicates if the user has given consent or not to the specific purpose.

`undefined` is returned if the consent status is not known yet. From a GDPR perspective, you'll want to treat `undefined` as `false` (ie no consent given) but it is helpful to know that the user has not interacted with the consent UI yet so that you can subscribe to events and wait for consent information to be collected.

If consent is not required because GDPR does not apply to that user, this function will return `true`.

**Example**

{% tabs %}
{% tab title="JavaScript" %}

```dart
await Didomi.getUserConsentStatusForPurpose("analytics");
```

{% endtab %}
{% endtabs %}

## getUserConsentStatusForVendor

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
Search the vendorId in `getUserStatus().vendors.consent.enabled` or `getUserStatus().vendors.consent.disabled`.
{% endhint %}

## getUserConsentStatusForVendorAndRequiredPurposes

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
Search the purposeId in `getUserStatus().vendors.global_consent.enabled` or `getUserStatus().vendors.global_consent.disabled`.
{% endhint %}

## getUserLegitimateInterestStatusForPurpose

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
Search the purposeId in `getUserStatus().purposes.legitimate_interest.enabled` or `getUserStatus().purposes.legitimate_interest.disabled`.
{% endhint %}

## getUserLegitimateInterestForVendor

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
Search the vendorId in `getUserStatus().vendors.legitimate_interest.enabled` or `getUserStatus().vendors.legitimate_interest.disabled`.
{% endhint %}

## getUserLegitimateInterestStatusForVendorAndRequiredPurposes

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
Search the vendorId in `getUserStatus().vendors.global_legitimate_interest.enabled` or `getUserStatus().vendors.global_legitimate_interest.disabled`.
{% endhint %}

## getUserStatus

**Deprecated**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

Get all the user consent status.

**Returns**

A `UserStatus` object describing all the available and computed user information.

| Parameter                                        | Type      | Description                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------ | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| purposes.global.disabled                         | string\[] | Computed sets/lists of disabled IDs of purposes that have been chosen by the user regarding the consent or legitimate interest Legal Basis.                                                                                                                                                                                 |
| purposes.global.enabled                          | string\[] | Computed sets/lists of enabled IDs of purposes that have been chosen by the user regarding the consent or legitimate interest Legal Basis. Purposes considered as essential will be part of the enabled IDs.                                                                                                                |
| purposes.consent.disabled                        | string\[] | Disabled IDs of purposes that have been explicitly chosen by the user regarding the consent Legal Basis.                                                                                                                                                                                                                    |
| purposes.consent.enabled                         | string\[] | Enabled IDs of purposes that have been explicitly chosen by the user regarding the consent Legal Basis.                                                                                                                                                                                                                     |
| purposes.legitimate\_interest.disabled           | string\[] | Disabled IDs of purposes that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.                                                                                                                                                                                                        |
| purposes.legitimate\_interest.enabled            | string\[] | Enabled IDs of purposes that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.                                                                                                                                                                                                         |
| purposes.essential                               | string\[] | IDs of purposes that are considered essential.                                                                                                                                                                                                                                                                              |
| vendors.global.disabled                          | string\[] | Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the consent or legitimate interest Legal Basis. This takes into account the consent and legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled. |
| vendors.global.enabled                           | string\[] | Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the consent or legitimate interest Legal Basis. This takes into account the consent and legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.  |
| vendors.global\_consent.disabled                 | string\[] | Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the consent Legal Basis. This takes into account the consent required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.                                                |
| vendors.global\_consent.enabled                  | string\[] | Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the consent Legal Basis. This takes into account the consent required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.                                                 |
| vendors.global\_legitimate\_interest.disabled    | string\[] | Computed sets/lists of disabled IDs of vendors that have been chosen by the user regarding the legitimate interest Legal Basis. This takes into account the legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.                        |
| vendors.global\_legitimate\_\_\_interest.enabled | string\[] | Computed sets/lists of enabled IDs of vendors that have been chosen by the user regarding the legitimate interest Legal Basis. This takes into account the legitimate interest required purposes linked to vendors. When computing this property, essential purposes will be considered as enabled.                         |
| vendors.consent.disabled                         | string\[] | Disabled IDs of vendors that have been explicitly chosen by the user regarding the consent Legal Basis.                                                                                                                                                                                                                     |
| vendors.consent.enabled                          | string\[] | Enabled IDs of vendors that have been explicitly chosen by the user regarding the consent Legal Basis.                                                                                                                                                                                                                      |
| vendors.legitimate\_interest.disabled            | string\[] | Disabled IDs of vendors that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.                                                                                                                                                                                                         |
| vendors.legitimate\_interest.enabled             | string\[] | Enabled IDs of vendors that have been explicitly chosen by the user regarding the legitimate interest Legal Basis.                                                                                                                                                                                                          |
| user\_id                                         | String    | Didomi user id.                                                                                                                                                                                                                                                                                                             |
| created                                          | String    | User choices creation date.                                                                                                                                                                                                                                                                                                 |
| updated                                          | String    | User choices update date.                                                                                                                                                                                                                                                                                                   |
| consent\_string                                  | String    | TFC consent as string.                                                                                                                                                                                                                                                                                                      |
| additional\_consent                              | String    | Additional consent for [Google Additional Consent Mode](https://gitlab.com/didomi/developers-documentation/-/blob/main/docs/docs/cmp/mobile-sdk/third-party-sdks.md#google-additional-consent-mode).                                                                                                                        |

**Example**

{% tabs %}
{% tab title="JavaScript" %}

<pre class="language-dart"><code class="lang-dart"><strong>let userStatus = await Didomi.getUserStatus();
</strong>
// Enabled consent ids for vendors
let enabledVendorsConsentIds = userStatus.vendors.consent.enabled;
</code></pre>

{% endtab %}
{% endtabs %}

## getUserStatusForVendor

**Removed since version 2.0.0**, use [getCurrentUserStatus](https://developers.didomi.io/cmp/mobile-sdk/react-native/reference/..#getcurrentuserstatus) instead.

{% hint style="info" %}
Search the vendorId in `getUserStatus().vendors.global.enabled` or `getUserStatus().vendors.global.disabled`.
{% endhint %}

## setUser

**Deprecated**, use [setUserWithParameters](#setuserwithparameters) instead.

Set custom user information from organization

**Parameters**

Name

| Name               | Type     | Description                                |
| ------------------ | -------- | ------------------------------------------ |
| organizationUserId | `string` | Organization ID to associate with the user |

**Returns**

Nothing

**Example**

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await Didomi.setUser("e3222031-7c45-4f4a-8851-ffd57dbf0a2a");
```

{% endtab %}
{% endtabs %}

## setUser

**Deprecated**, use [setUserWithParameters](#setuserwithparameters) instead.

Set custom user information from organization, with optional authentication parameters.

Name

| Name                            | Type     | Optional | Description                                    |
| ------------------------------- | -------- | -------- | ---------------------------------------------- |
| organizationUserId              | `string` | No       | Organization ID to associate with the user     |
| organizationUserIdAuthAlgorithm | `string` | Yes      | Algorithm used for computing the digest        |
| organizationUserIdAuthSid       | `string` | Yes      | ID of the secret used for computing the digest |
| organizationUserIdAuthSalt      | `string` | Yes      | Salt used for computing the digest (optional)  |
| organizationUserIdAuthDigest    | `string` | Yes      | Digest of the organization user ID and secret  |

**Returns**

Nothing

**Example**

{% tabs %}
{% tab title="JavaScript" %}

```javascript
await Didomi.setUser(
            "e3222031-7c45-4f4a-8851-ffd57dbf0a2a",
            "hash-md5",
            "secret_id",
            "salt",
            "098f6bcd4621d373cade4e832627b4f6"
);
```

{% endtab %}
{% endtabs %}

## setUserStatusSets

Set the user status for purposes and vendors. This function will trigger events and API calls every time it is called (and the user status changes) so make sure to push all user choices at once and not one by one.

Please read [our article](https://support.didomi.io/analytics-with-a-custom-setup) on what to expect from your analytics when setting a custom behavior for your consent notice.

**Parameters**

| Name                      | Type       | Description                                                                                                                                 |
| ------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| enabledConsentPurposeIds  | `string[]` | List of purpose IDs that the user has given consent to                                                                                      |
| disabledConsentPurposeIds | `string[]` | List of purpose IDs that the user has not given consent to                                                                                  |
| enabledLIPurposeIds       | `string[]` | List of purpose IDs that the user has allowed legitimate interest processing to                                                             |
| disabledLIPurposeIds      | `string[]` | List of purpose IDs that the user has disallowed legitimate interest processing to                                                          |
| enabledConsentVendorIds   | `string[]` | <p>List of vendor IDs that the user has given consent to.</p><p>Prefix custom vendor IDs with <code>c:</code>.</p>                          |
| disabledConsentVendorIds  | `string[]` | List of vendor IDs that the user has not given consent to                                                                                   |
| enabledLIVendorIds        | `string[]` | <p>List of vendor IDs that the user has allowed legitimate interest processing to.</p><p>Prefix custom vendor IDs with <code>c:</code>.</p> |
| disabledLIVendorIds       | `string[]` | List of vendor IDs that the user has not allowed legitimate interest processing to                                                          |

**Returns**

`Promise<boolean>`

`true` if the user choices have changed (i.e. the user had made different choices before this function got called).

**Example**

{% tabs %}
{% tab title="JavaScript" %}

```javascript
let result = await Didomi.setUserStatus(
    ["cookies", "advertising_personalization"],
    ["ad_delivery"],
    ["advertising_personalization"],
    ["ad_delivery"],
    ["123", "c:custom-vendor-id"],
    [],
    ["123", "c:custom-vendor-id"],
    []
);
```

{% endtab %}
{% endtabs %}
