קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
תכונות עיקריות
בנוסף למתן מזהים ייחודיים לאימות, מזהה המכונה יכול ליצור אסימוני אבטחה לשימוש בשירותים אחרים. תכונות נוספות:
יצירת אסימוני אבטחה
Instance ID מספק ממשק API פשוט ליצירת אסימוני אבטחה שמעניקים לצדדים שלישיים הרשאה לגשת למשאבים המנוהלים של האפליקציה בצד השרת.
אימות האותנטיות של האפליקציה
מעבירים אסימוני מזהה מכונה לשרת ומשתמשים בשירות מזהה המכונה כדי לאמת את שם חבילת האפליקציה ולבדוק אם יש לה חתימה תקפה.
אימות אסימונים באמצעות שירות Cloud של מזהה המכונה עוזר לזהות אפליקציות מוכרות. כדי לצמצם את העלות ואת התקשורת העודפת הלוך ושוב, כדאי להגדיר את השרת כך שיישמר את האסימונים האלה, כדי שהבדיקה תתבצע רק פעם אחת.
במקרה של חשש אבטחה, האפליקציה יכולה למחוק אסימונים או את מזהה המכונה עצמו וליצור אסימונים חדשים. בנוסף, השרת של מזהה המכונה יוזם רענון של האסימון או של מזהה המכונה אם הוא מזהה באגים או בעיות אבטחה.
מוודאים שהמכשיר של האפליקציה פעיל
השרת של מזהה המכונה יכול לומר לכם מתי בוצע השימוש האחרון במכשיר שבו מותקנת האפליקציה. בעזרת הנתונים האלה תוכלו להחליט אם לשמור נתונים מהאפליקציה או לשלוח הודעת Push כדי לעורר עניין מחדש בקרב המשתמשים.
זיהוי אפליקציות ומעקב אחריהן
מזהה המכונה
הוא ייחודי לכל המכונות של האפליקציה ברחבי העולם, כך שאפשר להשתמש בו במסד הנתונים כדי לזהות באופן ייחודי מכונות של אפליקציות ולעקוב אחריהן. הקוד בצד השרת יכול לאמת, באמצעות שירות הענן של מזהה המכונה, שמזהה המכונה הוא מזהה מקורי וזהה למזהה של האפליקציה המקורית שרשומה בשרת. מטעמי פרטיות, האפליקציה יכולה למחוק מזהה מכונה כדי שהוא לא ישויך יותר להיסטוריה כלשהי במסד הנתונים. בפעם הבאה שהאפליקציה תבצע קריאה למזהה המכונה, היא תקבל מזהה מכונה חדש לגמרי ללא קשר למזהה הקודם.
מחזור החיים של מזהה המכונה
שירות מזהה המכונה מנפיק InstanceID כשהאפליקציה מתחברת לאינטרנט.
המזהה InstanceID מגובה על ידי זוג מפתחות ציבורי/פרטי, כאשר המפתח הפרטי מאוחסן במכשיר המקומי והמפתח הציבורי רשום בשירות מזהה המכונה.
האפליקציה יכולה לבקש InstanceID חדש בכל פעם שנדרש באמצעות השיטה getID(). האפליקציה יכולה לאחסן אותו בשרת שלכם, אם יש לכם שרת שתומך באפליקציה.
האפליקציה יכולה לבקש טוקנים משירות מזהה המכונה לפי הצורך באמצעות השיטה getToken(), וכמו InstanceID, האפליקציה יכולה גם לאחסן טוקנים בשרת שלכם. כל האסימונים שהנפקת לאפליקציה שייכים ל-InstanceID של האפליקציה.
האסימונים ייחודיים ומאובטחים, אבל יכול להיות שהאפליקציה או שירות מזהה המכונה יצטרכו לרענן את האסימונים במקרה של בעיית אבטחה או כאשר משתמש מנתק את האפליקציה ומתקין אותה מחדש במהלך שחזור המכשיר. האפליקציה צריכה ליישם מאזין כדי להגיב לבקשות לרענון אסימונים מהשירות של מזהה המכונה.
הטמעה בצד הלקוח
מזהה המכונה פועל גם ב-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."]]