Apple 플랫폼에서 DeviceCheck로 앱 체크 사용 시작하기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 Apple 앱에서 내장된 DeviceCheck 제공자를 사용하여 App Check를 사용 설정하는 방법을 설명합니다. App Check를 사용 설정하면 사용자의 앱만 프로젝트의 Firebase 리소스에 액세스할 수 있습니다. 이 기능의 개요를 참조하세요.
자체 커스텀 제공자와 함께 App Check를 사용하려면 커스텀 App Check 제공자 구현을 참조하세요.
1. Firebase 프로젝트 설정
아직 추가하지 않았다면 Apple 프로젝트에 Firebase를 추가합니다.
Apple 개발자 사이트에서 DeviceCheck 비공개 키를 생성합니다.
Firebase Console의 App Check 섹션에서 DeviceCheck 제공자에 App Check를 사용하도록 앱을 등록합니다. 이전 단계에서 만든 비공개 키를 제공해야 합니다.
Firebase 제품에 적용을 사용 설정하면 등록된 앱만 제품의 백엔드 리소스에 액세스할 수 있으므로 일반적으로 프로젝트의 모든 앱을 등록해야 합니다.
-
선택사항: 앱 등록 설정에서 제공자가 발급한 App Check 토큰의 커스텀 TTL(수명)을 설정합니다. TTL은 30분에서 7일 사이의 값으로 설정할 수 있습니다. 이 값을 변경할 때는 다음 장단점을 고려하세요.
- 보안: TTL이 짧을수록 유출되거나 가로채인 토큰이 공격자에 의해 악용될 수 있는 기간이 줄어들므로 보안이 강화됩니다.
- 성능: TTL이 짧을수록 앱에서 증명을 더 자주 수행합니다. 앱 증명 프로세스는 실행될 때마다 네트워크 요청에 지연 시간이 추가되므로 짧은 TTL은 앱 성능에 영향을 줄 수 있습니다.
- 할당량 및 비용: 더 짧은 TTL과 빈번한 재증명으로 인해 할당량이 더 빨리 소진되며, 유료 서비스의 경우 더 많은 비용이 발생할 수 있습니다.
할당량 및 한도를 참조하세요.
대부분의 앱에 기본 TTL인 1시간이 적합합니다. App Check 라이브러리는 TTL 기간의 약 절반이 지났을 때 토큰을 새로고침합니다.
2. 앱에 App Check 라이브러리 추가
프로젝트의 Podfile
에 App Check 종속 항목을 추가합니다.
pod 'FirebaseAppCheck'
또는 Swift Package Manager를 사용해도 됩니다.
사용하는 Firebase 서비스 클라이언트 라이브러리의 최신 버전도 사용하고 있는지 확인합니다.
pod install
을 실행하고 생성된 .xcworkspace
파일을 엽니다.
다음 단계
앱에 App Check 라이브러리가 설치되면 업데이트된 앱을 사용자에게 배포하기 시작합니다.
업데이트된 클라이언트 앱이 Firebase에 전송하는 모든 요청과 함께 App Check 토큰을 보내기 시작하지만 Firebase 제품에서는 Firebase Console의 App Check 섹션에서 적용을 사용 설정할 때까지 토큰이 유효하지 않아도 됩니다.
측정항목 모니터링 및 적용 사용 설정
적용을 사용 설정하기 전에 먼저 이렇게 해도 기존의 정당한 사용자에게 불편을 야기하지 않는지 확인해야 합니다. 반면에 앱 리소스 사용이 의심스러워 보이면 적용을 더 빠르게 사용 설정하는 것이 좋습니다.
사용 중인 서비스의 App Check 측정항목을 확인하면 적용 여부에 대한 판단을 내리는 데 도움이 됩니다.
App Check 적용 사용 설정
App Check가 사용자에게 미치는 영향을 이해하고 계속 진행할 준비가 되면 App Check 적용을 사용 설정할 수 있습니다.
디버그 환경에서 App Check 사용
App Check에 앱을 등록한 후 App Check가 일반적으로 유효한 것으로 분류하지 않는 환경에서 앱을 실행하려는 경우(예: 개발 중 시뮬레이터에서 또는 지속적 통합(CI) 환경에서) 실제 증명 제공자 대신 App Check 디버그 제공자를 사용하는 앱의 디버그 빌드를 만들면 됩니다.
Apple 플랫폼에서 디버그 제공자와 함께 App Check 사용을 참조하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-24(UTC)
[null,null,["최종 업데이트: 2025-08-24(UTC)"],[],[],null,["This page shows you how to enable App Check in an Apple app, using the\nbuilt-in DeviceCheck provider. When you enable App Check, you help ensure\nthat only your app can access your project's Firebase resources. See an\n[Overview](/docs/app-check) of this feature.\n\nIf you want to use App Check with your own custom provider, see\n[Implement a custom App Check provider](/docs/app-check/ios/custom-provider).\n\n1. Set up your Firebase project\n\n1. [Add Firebase to your Apple project](/docs/ios/setup) if you haven't already\n done so.\n\n2. On the Apple developer site, [create a DeviceCheck private key](https://developer.apple.com/help/account/configure-app-capabilities/create-a-devicecheck-private-key/).\n\n3. Register your apps to use App Check with the DeviceCheck provider in the\n [**App Check**](//console.firebase.google.com/project/_/appcheck) section of the\n Firebase console. You will need to provide the private key you created in\n the previous step.\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.\n4. \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n **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 - 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 of\n **1 hour**\n is reasonable for most apps. Note that the App Check library refreshes\n tokens at approximately half the TTL duration.\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n2. Add the App Check library to your app\n\n1. Add the dependency for App Check to your project's `Podfile`:\n\n ```\n pod 'FirebaseAppCheck'\n ```\n\n Or, alternatively, you can use [Swift Package\n Manager](/docs/ios/swift-package-manager) instead.\n\n Make sure you're also using the latest version of any Firebase service\n client libraries you depend on.\n2. Run `pod install` and open the created `.xcworkspace` file.\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 Firebase AI Logic, Data Connect, Realtime Database, Cloud Firestore, Cloud Storage, Authentication, Google Identity for iOS, Maps JavaScript API, and Places API (New).\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 Firebase AI Logic, Data Connect, Realtime Database, Cloud Firestore, Cloud Storage, Authentication, Google Identity for iOS, Maps JavaScript API, and Places API (New).\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 a simulator during development, or from a continuous integration (CI)\nenvironment, you can create a debug build of your app that uses the\nApp Check debug provider instead of a real attestation provider.\n\nSee [Use App Check with the debug provider on Apple platforms](/docs/app-check/ios/debug-provider)."]]