Unity 앱에서 앱 체크 사용 시작하기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 Android의 Play Integrity, Apple 플랫폼의 Device Check 또는 App Attest 등 기본 제공자를 사용하여 Unity 앱에서 앱 체크를 사용 설정하는 방법을 설명합니다. 앱 체크를 사용 설정하면 사용자의 앱만 프로젝트의 Firebase 리소스에 액세스할 수 있습니다. 이 기능의 개요를 참조하세요.
1. Firebase 프로젝트 설정
아직 추가하지 않았다면 Unity 프로젝트에 Firebase를 추가합니다.
Firebase Console의 프로젝트 설정 > 앱 체크 섹션에서 Play Integrity, Device Check 또는 App Attest 제공자와 함께 앱 체크를 사용하도록 앱을 등록합니다.
Firebase 제품에 적용을 사용 설정하면 등록된 앱만 제품의 백엔드 리소스에 액세스할 수 있으므로 일반적으로 프로젝트의 모든 앱을 등록해야 합니다.
각 제공자에 등록하는 방법에 관한 자세한 안내는 Android 및 iOS 관련 문서를 참고하세요.
선택사항: 앱 등록 설정에서 제공자가 발급한 앱 체크 토큰의 커스텀 TTL(수명)을 설정합니다. TTL은 30분에서 7일 사이의 값으로 설정할 수 있습니다. 이 값을 변경할 때는 다음 장단점을 고려하세요.
- 보안: TTL이 짧을수록 유출되거나 가로채인 토큰이 공격자에 의해 악용될 수 있는 기간이 줄어들므로 보안이 강화됩니다.
- 성능: TTL이 짧을수록 앱에서 증명을 더 자주 수행합니다. 앱 증명 프로세스는 실행될 때마다 네트워크 요청에 지연 시간이 추가되므로 짧은 TTL은 앱 성능에 영향을 줄 수 있습니다.
- 할당량 및 비용: 더 짧은 TTL과 빈번한 재증명으로 인해 할당량이 더 빨리 소진되며, 유료 서비스의 경우 더 많은 비용이 발생할 수 있습니다.
할당량 및 한도를 참조하세요.
대부분의 앱에 기본 TTL이 적합합니다. 앱 체크 라이브러리는 TTL 기간의 약 절반이 지났을 때 토큰을 새로고침합니다.
2. 앱에 앱 체크 라이브러리 추가
앱 체크의 설정 안내에 따라 종속 항목 세트에 앱 체크 라이브러리를 포함합니다.
3. 앱 체크 초기화
Firebase 앱 생성을 포함하여 Firebase 서비스를 사용하기 전에 초기화 코드가 실행되도록 다음 초기화 코드를 앱에 추가합니다.
Android
Firebase.AppCheck
에 using 선언을 추가합니다.
using Firebase.AppCheck
Play Integrity 제공자로 앱 체크 라이브러리를 초기화합니다.
FirebaseAppCheck.SetAppCheckProviderFactory(
PlayIntegrityProviderFactory.Instance);
iOS+
Firebase.AppCheck
에 using 선언을 추가합니다.
using Firebase.AppCheck
Device Check 또는 App Attest 제공자로 앱 체크 라이브러리를 초기화합니다.
FirebaseAppCheck.SetAppCheckProviderFactory(
DeviceCheckProviderFactory.Instance);
다음 단계
앱에 앱 체크 라이브러리가 설치되면 업데이트된 앱을 사용자에게 배포하기 시작합니다.
업데이트된 클라이언트 앱이 Firebase에 전송하는 모든 요청과 함께 앱 체크 토큰을 보내기 시작하지만 Firebase 제품에서는 Firebase Console의 앱 체크 섹션에서 적용을 사용 설정할 때까지 토큰이 유효하지 않아도 됩니다.
측정항목 모니터링 및 적용 사용 설정
적용을 사용 설정하기 전에 먼저 이렇게 해도 기존의 정당한 사용자에게 불편을 야기하지 않는지 확인해야 합니다. 반면에 앱 리소스 사용이 의심스러워 보이면 적용을 더 빠르게 사용 설정하는 것이 좋습니다.
사용 중인 서비스의 앱 체크 측정항목을 확인하면 적용 여부에 대한 판단을 내리는 데 도움이 됩니다.
앱 체크 적용 사용 설정
앱 체크가 사용자에게 미치는 영향을 이해하고 계속 진행할 준비가 되면 앱 체크 적용을 사용 설정할 수 있습니다.
디버그 환경에서 앱 체크 사용
앱 체크에 앱을 등록한 후 앱 체크가 일반적으로 유효한 것으로 분류하지 않는 환경에서 앱을 실행하려는 경우(예: 데스크톱, 개발 시 에뮬레이터 또는 지속적 통합(CI) 환경) 실제 증명 제공자 대신 앱 체크 디버그 제공자를 사용하는 앱의 디버그 빌드를 만들면 됩니다.
Unity 앱에서 디버그 제공자와 함께 앱 체크 사용을 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-04(UTC)
[null,null,["최종 업데이트: 2025-08-04(UTC)"],[],[],null,["\u003cbr /\u003e\n\nThis page shows you how to enable App Check in a Unity app, using the\ndefault providers: Play Integrity on Android, and Device Check or App Attest on\nApple platforms. When you enable App Check, you help ensure that\nonly your app can access your project's Firebase resources. See an\n[Overview](/docs/app-check) of this feature.\n\n1. Set up your Firebase project\n\n1. [Add Firebase to your Unity project](/docs/unity/setup) if you haven't\n already done so.\n\n2. Register your apps to use App Check with the Play Integrity, Device Check,\n or App Attest providers in the\n [**Project Settings \\\u003e App Check**](https://console.firebase.google.com/project/_/appcheck)\n section of the Firebase console.\n\n You usually need to register all of your project's apps, because once you\n enable enforcement for a Firebase product, only registered apps will be able\n to access the product's backend resources.\n\n For detailed instructions on how to register with each provider, refer to\n the Android and iOS specific documentation.\n3. **Optional**: In the app registration settings, set a custom time-to-live\n (TTL) for App Check tokens issued by the provider. You can set the TTL\n to any value between 30 minutes and 7 days. When changing this value, be\n aware of the following tradeoffs:\n\n - Security: Shorter TTLs provide stronger security, because it reduces the window in which a leaked or intercepted token can be abused by an attacker.\n - Performance: Shorter TTLs mean your app will perform attestation more frequently. Because the app attestation process adds latency to network requests every time it's performed, a short TTL can impact the performance of your app.\n - Quota and cost: Shorter TTLs and frequent re-attestation deplete your quota faster, and for paid services, potentially cost more. See [Quotas \\& limits](/docs/app-check#quotas_limits).\n\n The default TTL\n is reasonable for most apps. Note that the App Check library refreshes\n tokens at approximately half the TTL duration.\n\n2. Add the App Check library to your app\n\nInclude the App Check library in your set of dependencies, following\n[the setup instructions](/docs/unity/setup#add-sdks) for App Check.\n\n3. Initialize App Check\n\nAdd the following initialization code to your app so that it runs before you\nuse any Firebase services including any creation of Firebase Apps. \n\nAndroid\n\n1. Add the using declaration for `Firebase.AppCheck`:\n\n ```c#\n using Firebase.AppCheck\n ```\n2. Initialize the App Check library with the Play Integrity provider:\n\n FirebaseAppCheck.SetAppCheckProviderFactory(\n PlayIntegrityProviderFactory.Instance);\n\niOS+\n\n1. Add the using declaration for `Firebase.AppCheck`:\n\n ```c#\n using Firebase.AppCheck\n ```\n2. Initialize the App Check library with the Device Check or App Attest\n provider:\n\n FirebaseAppCheck.SetAppCheckProviderFactory(\n DeviceCheckProviderFactory.Instance);\n\nNext steps\n\nOnce the App Check library is installed in your app, start distributing the\nupdated app to your users.\n\nThe updated client app will begin sending App Check tokens along with every\nrequest it makes to Firebase, but Firebase products will not require the tokens\nto be valid until you enable enforcement in the App Check section of the\nFirebase console.\n\nMonitor metrics and enable enforcement\n\nBefore you enable enforcement, however, you should make sure that doing so won't\ndisrupt your existing legitimate users. On the other hand, if you're seeing\nsuspicious use of your app resources, you might want to enable enforcement\nsooner.\n\nTo help make this decision, you can look at App Check metrics for the\nservices you use:\n\n- [Monitor App Check request metrics](/docs/app-check/monitor-metrics) for Realtime Database, Cloud Firestore, and Cloud Storage.\n- [Monitor App Check request metrics for Cloud Functions](/docs/app-check/monitor-functions-metrics).\n\nEnable App Check enforcement\n\nWhen you understand how App Check will affect your users and you're ready to\nproceed, you can enable App Check enforcement:\n\n- [Enable App Check enforcement](/docs/app-check/enable-enforcement) for Realtime Database, Cloud Firestore, and Cloud Storage.\n- [Enable App Check enforcement for Cloud Functions](/docs/app-check/cloud-functions).\n\nUse App Check in debug environments\n\nIf, after you have registered your app for App Check, you want to run your\napp in an environment that App Check would normally not classify as valid,\nsuch as on desktop, an emulator during development, or from a continuous\nintegration (CI) environment, you can create a debug build of your app that\nuses the App Check debug provider instead of a real attestation provider.\n\nSee [Use App Check with the debug provider in Unity apps](/docs/app-check/unity/debug-provider)."]]