Stay organized with collections
Save and categorize content based on your preferences.
AppSetId
open class AppSetId
A unique, per-device, per developer-account user-resettable ID for non-monetizing advertising usecases.
Represents the appSetID and scope of this appSetId from the android.adservices.appsetid.AppSetIdManager#getAppSetId(Executor,OutcomeReceiver) 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 Int |
The appSetId is scoped to an app.
|
static Int |
The appSetId is scoped to a developer account on an app store.
|
Public constructors |
Creates an instance of AppSetId
|
Public methods |
open Boolean |
|
open String |
Retrieves the appSetId.
|
open Int |
Retrieves the scope of the appSetId.
|
open Int |
|
Constants
SCOPE_APP
static val SCOPE_APP: Int
The appSetId is scoped to an app. All apps on a device will have a different appSetId.
Value: 1
SCOPE_DEVELOPER
static val SCOPE_DEVELOPER: 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.
Value: 2
Public constructors
AppSetId
AppSetId(
appSetId: String,
appSetIdScope: Int)
Creates an instance of AppSetId
Public methods
equals
open fun equals(other: Any?): Boolean
Parameters |
obj |
the reference object with which to compare. |
Return |
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getId
open fun getId(): String
Retrieves the appSetId. The api always returns a non-empty appSetId.
Return |
String |
This value cannot be null . |
getScope
open fun getScope(): Int
Retrieves the scope of the appSetId.
hashCode
open fun hashCode(): Int
Return |
Int |
a hash code value for this object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# AppSetId\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions)\n\nAppSetId\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/adservices/appsetid/AppSetId \"View this page in Java\") \n\n```\nopen class AppSetId\n```\n\n|---|-------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.adservices.appsetid.AppSetId](#) |\n\nA unique, per-device, per developer-account user-resettable ID for non-monetizing advertising usecases.\n\nRepresents the appSetID and scope of this appSetId from the android.adservices.appsetid.AppSetIdManager#getAppSetId(Executor,OutcomeReceiver) 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.\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SCOPE_APP](#SCOPE_APP:kotlin.Int) The appSetId is scoped to an app. |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SCOPE_DEVELOPER](#SCOPE_DEVELOPER:kotlin.Int) The appSetId is scoped to a developer account on an app store. |\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [AppSetId](#AppSetId(kotlin.String,%20kotlin.Int))`(`appSetId:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, `appSetIdScope:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates an instance of [AppSetId](#) |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------|\n| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` \u003cbr /\u003e |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [getId](#getId())`()` Retrieves the appSetId. |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getScope](#getScope())`()` Retrieves the scope of the appSetId. |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [hashCode](#hashCode())`()` \u003cbr /\u003e |\n\nConstants\n---------\n\n### SCOPE_APP\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nstatic val SCOPE_APP: Int\n```\n\nThe appSetId is scoped to an app. All apps on a device will have a different appSetId. \n\n Value: 1\n\n### SCOPE_DEVELOPER\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nstatic val SCOPE_DEVELOPER: Int\n```\n\nThe 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. \n\n Value: 2\n\nPublic constructors\n-------------------\n\n### AppSetId\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nAppSetId(\n appSetId: String, \n appSetIdScope: Int)\n```\n\nCreates an instance of [AppSetId](#)\n\n| Parameters ||\n|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `appSetId` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): generated by the provider service. This value cannot be `null`. |\n| `appSetIdScope` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): scope of the appSetId. Value is [android.adservices.appsetid.AppSetId#SCOPE_APP](#SCOPE_APP:kotlin.Int), or [android.adservices.appsetid.AppSetId#SCOPE_DEVELOPER](#SCOPE_DEVELOPER:kotlin.Int) |\n\nPublic methods\n--------------\n\n### equals\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun equals(other: Any?): Boolean\n```\n\n| Parameters ||\n|-------|---------------------------------------------|\n| `obj` | the reference object with which to compare. |\n\n| Return ||\n|------------------------------------------------------------------------------------|---------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true` if this object is the same as the obj argument; `false` otherwise. |\n\n### getId\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nopen fun getId(): String\n```\n\nRetrieves the appSetId. The api always returns a non-empty appSetId.\n\n| Return ||\n|----------------------------------------------------------------------------------|------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | This value cannot be `null`. |\n\n### getScope\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nAlso in [Ad Services Extensions 4](https://developer.android.com/sdkExtensions) \n\n```\nopen fun getScope(): Int\n```\n\nRetrieves the scope of the appSetId.\n\n| Return ||\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | Value is [android.adservices.appsetid.AppSetId#SCOPE_APP](#SCOPE_APP:kotlin.Int), or [android.adservices.appsetid.AppSetId#SCOPE_DEVELOPER](#SCOPE_DEVELOPER:kotlin.Int) |\n\n### hashCode\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun hashCode(): Int\n```\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |"]]