# AppSetId

Artifact: [androidx.privacysandbox.ads:ads-adservices](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads) [View Source](https://cs.android.com/search?q=file:androidx/privacysandbox/ads/adservices/appsetid/AppSetId.kt+class:androidx.privacysandbox.ads.adservices.appsetid.AppSetId) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

*** ** * ** ***


```
public final class AppSetId
```

<br />

*** ** * ** ***

A unique, per-device, per developer-account user-resettable ID for non-monetizing advertising use cases.

Represents the appSetID and scope of this appSetId from the AppSetIdManager#getAppSetId() API. The scope of the ID can be per app or per developer account associated with the user. AppSetId is used for analytics, spam detection, frequency capping and fraud prevention use cases, on a given device, that one may need to correlate usage or actions across a set of apps owned by an organization.

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#SCOPE_APP() = 1` The appSetId is scoped to an app. |
| `static final int` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#SCOPE_DEVELOPER() = 2` The appSetId is scoped to a developer account on an app store. |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#AppSetId(kotlin.String,kotlin.Int)(@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id, int scope)` |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#equals(kotlin.Any)(https://developer.android.com/reference/java/lang/Object.html other)` |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#getId()()` The appSetID. |
| `final int` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#getScope()()` The scope of the ID. |
| `int` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#hashCode()()` |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#toString()()` |

## Constants

### SCOPE_APP

```
public static final int SCOPE_APP = 1
```

The appSetId is scoped to an app. All apps on a device will have a different appSetId.

### SCOPE_DEVELOPER

```
public static final int SCOPE_DEVELOPER = 2
```

The appSetId is scoped to a developer account on an app store. All apps from the same developer on a device will have the same developer scoped appSetId.

## Public constructors

### AppSetId

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
public AppSetId(@NonNull String id, int scope)
```

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html id` | The appSetID. |
| `int scope` | The scope of the ID. Can be AppSetId.SCOPE_APP or AppSetId.SCOPE_DEVELOPER. |

## Public methods

### equals

```
public boolean equals(Object other)
```

### getId

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
public final @NonNull String getId()
```

The appSetID.

### getScope

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/privacysandbox-ads#1.0.0)

```
public final int getScope()
```

The scope of the ID. Can be AppSetId.SCOPE_APP or AppSetId.SCOPE_DEVELOPER.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```