# AppSetId

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/privacysandbox/ads/adservices/appsetid/AppSetId "View this page in Java")

<br />

```
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                                    |
|-------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SCOPE_APP](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#SCOPE_APP())` = 1` The appSetId is scoped to an app.                                          |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [SCOPE_DEVELOPER](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#SCOPE_DEVELOPER())` = 2` The appSetId is scoped to a developer account on an app store. |

|                                                                                                                                                         ### Public constructors                                                                                                                                                         |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [AppSetId](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#AppSetId(kotlin.String,kotlin.Int))`(id: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`, scope: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` |

|                                        ### Public functions                                         |
|-----------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `open operator `[Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html) | [equals](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#equals(kotlin.Any))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| `open `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                  | [hashCode](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#hashCode())`()`                                                                                            |
| `open `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)            | [toString](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#toString())`()`                                                                                            |

|                               ### Public properties                               |
|-----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------|
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | [id](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#id()) The appSetID.              |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)       | [scope](https://developer.android.com/reference/kotlin/androidx/privacysandbox/ads/adservices/appsetid/AppSetId#scope()) The scope of the ID. |

## Constants

### SCOPE_APP

```
const val SCOPE_APP = 1: Int
```

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

### SCOPE_DEVELOPER

```
const val SCOPE_DEVELOPER = 2: Int
```

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)  

```
AppSetId(id: String, scope: Int)
```  

|                                       Parameters                                        |
|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------|
| `id: `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html) | The appSetID.                                                               |
| `scope: `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)    | The scope of the ID. Can be AppSetId.SCOPE_APP or AppSetId.SCOPE_DEVELOPER. |

## Public functions

### equals

```
open operator fun equals(other: Any?): Boolean
```  

### hashCode

```
open fun hashCode(): Int
```  

### toString

```
open fun toString(): String
```  

## Public properties

### id

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

```
val id: String
```

The appSetID.  

### scope

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

```
val scope: Int
```

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