संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
मुख्य सुविधाएं
पुष्टि करने के लिए यूनीक आईडी देने के अलावा, इंस्टेंस आईडी, अन्य सेवाओं के साथ इस्तेमाल करने के लिए सुरक्षा टोकन जनरेट कर सकता है. अन्य सुविधाओं में ये शामिल हैं:
सुरक्षा टोकन जनरेट करना
इंस्टेंस आईडी, सुरक्षा टोकन जनरेट करने के लिए एक आसान एपीआई उपलब्ध कराता है. इससे तीसरे पक्ष को आपके ऐप्लिकेशन के सर्वर साइड से मैनेज किए जाने वाले संसाधनों को ऐक्सेस करने की अनुमति मिलती है.
ऐप्लिकेशन की पुष्टि करना
अपने सर्वर पर इंस्टेंस आईडी टोकन भेजें और ऐप्लिकेशन पैकेज के नाम की पुष्टि करने के लिए, इंस्टेंस आईडी सेवा का इस्तेमाल करें. साथ ही, यह भी देखें कि उसमें मान्य हस्ताक्षर है या नहीं.
Instance ID Cloud Service की मदद से टोकन की पुष्टि करने से, जाने-पहचाने ऐप्लिकेशन की पहचान करने में मदद मिलती है. लागत और बार-बार होने वाले राउंड ट्रिप कम्यूनिकेशन को कम करने के लिए, अपने सर्वर को इन टोकन को सेव करने के लिए कॉन्फ़िगर करें, ताकि पुष्टि सिर्फ़ एक बार की जा सके.
सुरक्षा से जुड़ी किसी समस्या के मामले में, आपका ऐप्लिकेशन टोकन या खुद इंस्टेंस आईडी मिटा सकता है और नए जनरेट कर सकता है. इसके अलावा, अगर इंस्टेंस आईडी सर्वर को गड़बड़ियां या सुरक्षा से जुड़ी समस्याएं मिलती हैं, तो वह टोकन या इंस्टेंस आईडी को रीफ़्रेश करने की प्रोसेस शुरू करता है.
पुष्टि करें कि ऐप्लिकेशन डिवाइस चालू है
इंस्टेंस आईडी सर्वर से आपको यह पता चल सकता है कि आपके ऐप्लिकेशन को जिस डिवाइस पर इंस्टॉल किया गया है उसका पिछली बार कब इस्तेमाल किया गया था. इसका इस्तेमाल करके यह तय करें कि आपको अपने ऐप्लिकेशन का डेटा रखना है या अपने उपयोगकर्ताओं से फिर से जुड़ने के लिए पुश मैसेज भेजना है.
ऐप्लिकेशन की पहचान करना और उन्हें ट्रैक करना
इंस्टेंस आईडी, दुनिया भर के सभी ऐप्लिकेशन इंस्टेंस के लिए यूनीक होता है. इसलिए, आपका डेटाबेस इसका इस्तेमाल करके, ऐप्लिकेशन इंस्टेंस की खास पहचान कर सकता है और उन्हें ट्रैक कर सकता है. आपका सर्वर-साइड कोड, Instance ID क्लाउड सेवा की मदद से पुष्टि कर सकता है कि कोई Instance ID सही है या नहीं. साथ ही, यह भी पुष्टि की जा सकती है कि यह वही आईडी है जो आपके सर्वर पर रजिस्टर किए गए ओरिजनल ऐप्लिकेशन का है. निजता बनाए रखने के लिए, आपका ऐप्लिकेशन किसी इंस्टेंस आईडी को मिटा सकता है, ताकि वह डेटाबेस में मौजूद किसी भी इतिहास से जुड़ा न रहे. अगली बार जब आपका ऐप्लिकेशन इंस्टेंस आईडी को कॉल करेगा, तो उसे एक नया इंस्टेंस आईडी मिलेगा. यह आईडी, पिछले आईडी से बिलकुल अलग होगा.
इंस्टेंस आईडी का लाइफ़साइकल
जब आपका ऐप्लिकेशन ऑनलाइन आता है, तब इंस्टेंस आईडी सेवा एक InstanceID जारी करती है.
InstanceID को सार्वजनिक/निजी पासकोड की जोड़ी से सुरक्षित किया जाता है. इसमें निजी पासकोड, स्थानीय डिवाइस पर सेव होता है और सार्वजनिक पासकोड, Instance ID सेवा के साथ रजिस्टर होता है.
आपका ऐप्लिकेशन, getID()
तरीका इस्तेमाल करके, ज़रूरत पड़ने पर नए InstanceID का अनुरोध कर सकता है. अगर आपके पास ऐसा सर्वर है जो आपके ऐप्लिकेशन के साथ काम करता है, तो आपका ऐप्लिकेशन उसे अपने सर्वर पर सेव कर सकता है.
आपका ऐप्लिकेशन getToken() तरीके का इस्तेमाल करके, ज़रूरत के हिसाब से इंस्टेंस आईडी सेवा से टोकन का अनुरोध कर सकता है. साथ ही, InstanceID की तरह ही आपका ऐप्लिकेशन अपने सर्वर पर भी टोकन सेव कर सकता है. आपके ऐप्लिकेशन को जारी किए गए सभी टोकन, ऐप्लिकेशन के
InstanceID से जुड़े होते हैं.
टोकन यूनीक और सुरक्षित होते हैं. हालांकि, सुरक्षा से जुड़ी किसी समस्या के मामले में या डिवाइस को वापस लाने के दौरान, जब कोई उपयोगकर्ता आपके ऐप्लिकेशन को अनइंस्टॉल करके फिर से इंस्टॉल करता है, तो हो सकता है कि आपके ऐप्लिकेशन या Instance ID सेवा को टोकन रीफ़्रेश करने पड़ें. आपके ऐप्लिकेशन को, Instance ID सेवा से टोकन रीफ़्रेश करने के अनुरोधों का जवाब देने के लिए, एक लिसनर लागू करना होगा.
क्लाइंट लागू करना
इंस्टेंस आईडी, Android और iOS, दोनों पर काम करता है. हर प्लैटफ़ॉर्म के लिए, आपको अपने क्लाइंट ऐप्लिकेशन में सही लाइब्रेरी शामिल करनी होगी. Android के लिए, Google Play services की ज़रूरत होती है. अगर आपको टोकन जनरेट करने हैं, तो आपको Google Developers Console से जनरेट किया गया प्रोजेक्ट आईडी चाहिए.
ज़्यादा जानकारी के लिए, Android और iOS पर लागू करने से जुड़ी गाइड देखें.
[null,null,["आखिरी बार 2025-08-31 (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."]]