특정 기기에서 분석 또는 사기 방지와 같은 사용 사례의 경우 조직이 소유한 여러 앱에 걸쳐 사용량 또는 작업을 상호 연관시켜야 할 수 있습니다. Google Play 서비스는 앱 세트 ID라는 개인 정보 보호 옵션을 제공합니다.
앱 세트 ID 범위
앱 세트 ID에는 다음 정의된 범위 중 하나가 있을 수 있습니다. 특정 ID가 연결된 범위를 확인하려면 getScope()를 호출합니다.
Google Play 개발자 범위
Google Play 스토어에서 설치한 앱의 경우 앱 세트 ID API는 동일한 Google Play 개발자 계정으로 게시된 앱 세트에 범위가 지정된 ID를 반환합니다.
예를 들어 Google Play 개발자 계정으로 두 개의 앱을 게시하고 두 앱이 모두 Google Play 스토어를 통해 동일한 기기에 설치된다고 가정해 보겠습니다. 앱이 해당 기기에서 동일한 앱 세트 ID를 공유합니다. 앱이 서로 다른 키로 서명된 경우에도 ID는 동일합니다.
앱 범위
다음 조건 중 하나에 해당하는 경우 앱 세트 ID SDK는 특정 기기에서 호출 앱 자체에 고유한 ID를 반환합니다.
Google Play 스토어가 아닌 설치 프로그램에 의해 앱이 설치됩니다.
Google Play 서비스에서 앱의 Google Play 개발자 계정을 확인할 수 없습니다.
앱이 Google Play 서비스가 없는 기기에 설치되어 있습니다.
캐시된 앱 세트 ID 값에 의존하지 않음
다음 조건 중 하나에 해당하는 경우 기기에 설치된 특정 Google Play 스토어 앱 세트의 앱 세트 ID가 재설정될 수 있습니다.
동일한 ID 값을 공유하는 앱 그룹이 13개월 넘게 앱 세트 ID API에 액세스하지 않았습니다.
특정 앱 세트의 마지막 앱이 기기에서 제거됩니다.
사용자가 기기를 초기화합니다.
앱은 필요할 때마다 SDK를 사용하여 ID 값을 검색해야 합니다.
앱에 앱 세트 ID SDK 추가
다음 스니펫은 앱 세트 ID 라이브러리를 사용하는 build.gradle 파일의 예를 보여줍니다.
다음 샘플 스니펫은 Google Play 서비스에서 Tasks API를 사용하여 앱 세트 ID를 비동기적으로 가져오는 방법을 보여줍니다.
Kotlin
valclient=AppSet.getClient(applicationContext)asAppSetIdClientvaltask:Task<AppSetIdInfo>=client.appSetIdInfoasTask<AppSetIdInfo>task.addOnSuccessListener({// Determine current scope of app set ID.valscope:Int=it.scope// Read app set ID value, which uses version 4 of the// universally unique identifier (UUID) format.valid:String=it.id})
Java
Contextcontext=getApplicationContext();AppSetIdClientclient=AppSet.getClient(context);Task<AppSetIdInfo>task=client.getAppSetIdInfo();task.addOnSuccessListener(newOnSuccessListener<AppSetIdInfo>(){@OverridepublicvoidonSuccess(AppSetIdInfoinfo){// Determine current scope of app set ID.intscope=info.getScope();// Read app set ID value, which uses version 4 of the// universally unique identifier (UUID) format.Stringid=info.getId();}});
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-09-03(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-03(UTC)"],[],[],null,["For use cases such as analytics or fraud prevention on a given device, you may\nneed to correlate usage or actions across a set of apps owned by your\norganization. [Google Play services](https://developers.google.com/android)\noffers a privacy-friendly option called [*app set ID*](https://developers.google.com/android/reference/com/google/android/gms/appset/AppSetIdInfo).\n\nApp set ID scope\n\nThe app set ID can have one of the following defined scopes. To determine which\nscope a particular ID is associated with, call\n[`getScope()`](https://developers.google.com/android/reference/com/google/android/gms/appset/AppSetIdInfo#getScope()).\n| **Caution:** When Google Play services updates from a version that only supports app scope to a version that supports developer scope, the app set ID's value is reset automatically, without any developer action. See [other reasons developers\n| shouldn't rely on a cached value of the app set ID](#dont-rely-on-cached-value).\n\nGoogle Play developer scope **Note:** The app set SDK attempts to return app set IDs that have the developer scope without any additional developer action, unless the app satisfies the conditions for app scope, described below.\n\nFor apps that are installed by the Google Play store, the app set ID API returns\nan ID scoped to the set of apps published under the same Google Play developer\naccount.\n\nFor example, suppose you publish two apps under your Google Play developer\naccount and both apps are installed on the same device through the Google Play\nstore. The apps share the same app set ID on that device. The ID is the same\neven if the apps are signed by different keys.\n\nApp scope\n\nUnder any of the following conditions, the app set ID SDK returns an ID unique\nto the calling app itself on a given device:\n\n- The app is installed by an installer other than the Google Play store.\n- Google Play services is unable to determine an app's Google Play developer account.\n- The app is installed on a device without Google Play services.\n\nDon't rely on a cached value of app set ID\n\nUnder any of the following conditions, the app set ID for a given set of Google\nPlay store-installed apps on a device can be reset:\n\n- The app set ID API hasn't been accessed by the groups of apps that share the same ID value for over 13 months.\n- The last app from a given set of apps is uninstalled from the device.\n- The user performs a factory reset of the device.\n\nYour app should use the SDK to retrieve the ID value every time it's needed.\n\nAdd the app set ID SDK to your app\n\nThe following snippet shows an example `build.gradle` file that uses the app set\nID library: \n\n dependencies {\n implementation 'com.google.android.gms:play-services-appset:16.1.0'\n }\n\nThe following sample snippet demonstrates how you can retrieve the app set ID\nasynchronously using the [Tasks\nAPI](https://developers.google.com/android/guides/tasks) in Google Play\nservices: \n\nKotlin \n\n```kotlin\nval client = AppSet.getClient(applicationContext) as AppSetIdClient\nval task: Task\u003cAppSetIdInfo\u003e = client.appSetIdInfo as Task\u003cAppSetIdInfo\u003e\n\ntask.addOnSuccessListener({\n // Determine current scope of app set ID.\n val scope: Int = it.scope\n\n // Read app set ID value, which uses version 4 of the\n // https://en.wikipedia.org/wiki/Universally_unique_identifier.\n val id: String = it.id\n})\n```\n\nJava \n\n```java\nContext context = getApplicationContext();\nAppSetIdClient client = AppSet.getClient(context);\nTask\u003cAppSetIdInfo\u003e task = client.getAppSetIdInfo();\n\ntask.addOnSuccessListener(new OnSuccessListener\u003cAppSetIdInfo\u003e() {\n @Override\n public void onSuccess(AppSetIdInfo info) {\n // Determine current scope of app set ID.\n int scope = info.getScope();\n\n // Read app set ID value, which uses version 4 of the\n // https://en.wikipedia.org/wiki/Universally_unique_identifier.\n String id = info.getId();\n }\n});\n```"]]