인증을 위한 고유 ID를 제공하는 것 외에도 인스턴스 ID는 다른 서비스와 함께 사용할 보안 토큰을 생성할 수 있습니다. 기타 기능은 다음과 같습니다.
보안 토큰 생성
인스턴스 ID는 서드 파티가 앱의 서버 측 관리 리소스에 액세스할 수 있도록 승인하는 보안 토큰을 생성하는 간단한 API를 제공합니다.
앱 진위성 확인
인스턴스 ID 토큰을 서버에 전달하고 인스턴스 ID 서비스를 사용하여 앱 패키지 이름을 확인하고 유효한 서명이 있는지 확인합니다.
인스턴스 ID Cloud Service로 토큰을 확인하면 알려진 앱을 식별하는 데 도움이 됩니다. 비용과 중복 왕복 통신을 줄이려면 확인이 한 번만 필요하도록 서버가 이러한 토큰을 저장하도록 구성하세요.
보안 문제가 발생하면 앱에서 토큰 또는 인스턴스 ID 자체를 삭제하고 새 토큰을 생성할 수 있습니다. 또한 인스턴스 ID 서버는 버그나 보안 문제를 감지하면 토큰 또는 인스턴스 ID 새로고침을 시작합니다.
앱 기기가 활성 상태인지 확인
인스턴스 ID 서버는 앱이 설치된 기기가 마지막으로 사용된 시점을 알려줄 수 있습니다. 이를 사용하여 앱의 데이터를 유지할지 아니면 푸시 메시지를 보내 사용자의 참여를 유도할지 결정합니다.
앱 식별 및 추적
인스턴스 ID는 전 세계의 모든 앱 인스턴스에서 고유하므로 데이터베이스에서 이를 사용하여 앱 인스턴스를 고유하게 식별하고 추적할 수 있습니다. 서버 측 코드는 인스턴스 ID 클라우드 서비스를 통해 인스턴스 ID가 진짜이고 서버에 등록된 원래 앱과 동일한 ID인지 확인할 수 있습니다. 개인 정보 보호를 위해 앱은 인스턴스 ID를 삭제하여 더 이상 데이터베이스의 기록과 연결되지 않도록 할 수 있습니다. 다음에 앱에서 인스턴스 ID를 호출하면 이전 인스턴스 ID와 관련이 없는 완전히 새로운 인스턴스 ID가 반환됩니다.
인스턴스 ID 수명 주기
앱이 온라인 상태가 되면 인스턴스 ID 서비스에서 InstanceID를 발급합니다.
InstanceID는 비공개 키가 로컬 기기에 저장되고 공개 키가 인스턴스 ID 서비스에 등록된 공개/비공개 키 쌍으로 지원됩니다.
앱은 getID() 메서드를 사용하여 필요할 때마다 새로운 InstanceID를 요청할 수 있습니다. 앱을 지원하는 서버가 있는 경우 앱에서 서버에 저장할 수 있습니다.
앱은 getToken() 메서드를 사용하여 필요에 따라 인스턴스 ID 서비스에서 토큰을 요청할 수 있으며 InstanceID와 마찬가지로 앱은 자체 서버에 토큰을 저장할 수도 있습니다. 앱에 발급된 모든 토큰은 앱의 InstanceID에 속합니다.
토큰은 고유하고 안전하지만 보안 문제가 발생하거나 사용자가 기기 복원 중에 앱을 제거했다가 다시 설치하는 경우 앱이나 인스턴스 ID 서비스에서 토큰을 새로고침해야 할 수 있습니다. 앱은 인스턴스 ID 서비스의 토큰 새로고침 요청에 응답하는 리스너를 구현해야 합니다.
[null,null,["최종 업데이트: 2025-09-05(UTC)"],[[["\u003cp\u003e\u003cstrong\u003eWarning:\u003c/strong\u003e The Instance ID API is deprecated; for unique app installation identifiers, use the Firebase installations API instead.\u003c/p\u003e\n"],["\u003cp\u003eInstance ID offers key features like generating security tokens, verifying app authenticity, confirming app device activity, and identifying/tracking apps.\u003c/p\u003e\n"],["\u003cp\u003eInstance ID has a lifecycle involving issuing an ID, requesting fresh IDs and tokens, storing them on the server (optional), and handling token refreshes.\u003c/p\u003e\n"],["\u003cp\u003eClient implementation requires including the appropriate library and potentially a Project ID for token generation.\u003c/p\u003e\n"],["\u003cp\u003eFor detailed instructions, refer to the Android and iOS implementation guides.\u003c/p\u003e\n"]]],[],null,["# What is Instance ID?\n\n| **Warning:** The Instance ID API is deprecated. If you need to access unique app installation identifiers, use the [Firebase installations](//firebase.google.com/docs/projects/manage-installations) API. See also [Firebase installations and Instance ID](//firebase.google.com/docs/projects/manage-installations#fid-iid). The [server-side topic management API](https://developers.google.com/instance-id/reference/server#create_relationship_maps_for_app_instances) is still available.\n\nKey features\n------------\n\nIn addition to providing unique IDs for authentication, Instance ID\ncan generate security tokens for use with other services. Other features\ninclude:\n\n### Generate Security Tokens\n\n: Instance ID provides a simple API to generate security tokens that\n authorize third parties to access your app's server side managed resources.\n\n### Verify app authenticity\n\n: Pass Instance ID tokens to your server and use the Instance ID\n service to verify the app package name and check if it has a valid signature.\n Verifying tokens with the Instance ID Cloud Service helps identify known\n apps. To reduce cost and redundant round trip communications, configure your\n server to store these tokens so the check is needed only once.\n In the event of a security concern, your app can delete tokens, or\n Instance ID itself, and generate new ones. In addition, the\n Instance ID server initiates token or Instance ID refresh if it\n detects bugs or security issues.\n\n### Confirm app device is active\n\n: The Instance ID server can tell you when the device on which your app\n is installed was last used. Use this to decide whether to keep data from your\n app or send a push message to reengage with your users.\n\n### Identify and track apps\n\n: Instance ID is unique across all app instances across the world, so\n your database can use it to uniquely identify and track app instances. Your\n server-side code can verify, via the Instance ID cloud service, that an\n Instance ID is genuine and is the same ID as the original app that\n registered with your server. For privacy, your app can delete an Instance ID so\n it is no longer associated with any history in the database. The next time your\n app calls Instance ID it will get an entirely new Instance ID with no\n relationship to its previous one.\n\nInstance ID lifecycle\n---------------------\n\n1. The Instance ID service issues an `InstanceID` when your app comes online. The `InstanceID` is backed by a public/private key pair with the private key stored on the local device and the public key registered with the Instance ID service.\n2. Your app can request a fresh `InstanceID` whenever needed using the `getID()` method. Your app can store it on your server if you have one that supports your app.\n3. Your app can request tokens from the Instance ID service as needed using the `getToken()` method, and like `InstanceID`, your app can also store tokens on your own server. All tokens issued to your app belong to the app's `InstanceID`.\n4. Tokens are unique and secure, but your app or the Instance ID service may need to refresh tokens in the event of a security issue or when a user uninstalls and reinstalls your app during device restoration. Your app must implement a listener to respond to token refresh requests from the Instance ID service.\n\nClient implementation\n---------------------\n\nInstance ID runs on both Android and iOS. Each requires you to include\nthe appropriate library in your client app. Android requires\n[Google Play Services](https://developer.android.com/google/play-services/index.html). You will need a Project ID generated\nby the [](/console/help/new)[Google Developers Console](https://console.developers.google.com/project) if you intend\nto generate tokens.\n\nFor detailed instructions, see the [Android](/instance-id/guides/android-implementation)\nand [iOS](/instance-id/guides/ios-implementation) implementation guides."]]