Örnek Kimliği API'si
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Instance ID API, Instance ID'yi Android veya iOS uygulamanızla entegre etmenize olanak tanır. Instance ID, uygulamanızın her örneği için benzersiz bir tanımlayıcı ve işlemleri kimlik doğrulama ve yetkilendirme mekanizması sağlar. InstanceID
uzun ömürlüdür ancak aşağıdaki nedenlerle süresi dolabilir:
- Cihazın fabrika ayarlarına sıfırlanması.
- Kullanıcı uygulamayı kaldırır.
- Kullanıcı uygulamada "Verileri Temizle"yi gerçekleştirir.
- Cihaz uzun süre kullanılmadıysa (zaman aralığı cihaz ve bölgeye göre belirlenir).
- Instance ID hizmeti, kötüye kullanım veya hataları algılayıp
InstanceID
öğesini sıfırlar.
- İstemci uygulamanız bu işlevi gerektiriyorsa sunucu tarafı kod.
Instance-ID hizmeti, InstanceIDListenerService
çağrısı aracılığıyla uygulamanızı InstanceID
sıfırlama hakkında bilgilendirir. Uygulamanız bu bildirimi alırsa getToken()
'ü çağırıp yeni InstanceID
'ı almalıdır ve sunucularını güncellemelidir.
InstanceID
'un sahipliğini kanıtlamak ve sunucuların uygulamayla ilişkili verilere veya hizmetlere erişmesine izin vermek için getToken
yöntemini kullanın. Bu yöntem, OAuth2 kalıplarını izler ve bir authorizedEntity
ve scope
gerektirir. authorizedEntity
, proje kimliği veya başka bir InstanceID
olabilir ve oluşturulan jetonu kullanma yetkisine sahip hizmetleri belirler. scope
, jetonun erişime izin verdiği belirli hizmeti veya verileri belirler.
Aşağıdakiler için Instance ID API hakkında daha fazla bilgi edinin:
Android
iOS
Sunucu
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-08-31 UTC.
[null,null,["Son güncelleme tarihi: 2025-08-31 UTC."],[[["\u003cp\u003eThe Instance ID API provides a unique identifier for each app instance and enables authentication and authorization.\u003c/p\u003e\n"],["\u003cp\u003eInstance IDs are long-lived but can expire due to various factors like device reset, uninstallation, data clearing, extended inactivity, or service-detected issues.\u003c/p\u003e\n"],["\u003cp\u003eUpon Instance ID reset, apps are notified and must retrieve a new ID using \u003ccode\u003egetToken()\u003c/code\u003e and update their servers.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003egetToken()\u003c/code\u003e method, using OAuth2 patterns, verifies Instance ID ownership and grants server access to associated data or services based on authorized entity and scope.\u003c/p\u003e\n"]]],[],null,["# Instance ID API\n\nThe Instance ID API lets you integrate Instance ID with your Android\nor iOS app. Instance ID provides a unique identifier for each instance of\nyour app and a mechanism to authenticate and authorize actions. The `InstanceID` is long\nlived, but may expire for the following reasons:\n\n- Device factory reset.\n- User uninstalls the app.\n- User performs \"Clear Data\" in the app.\n- Device unused for an extended period (device and region determines the timespan).\n- Instance ID service detects abuse or errors and resets the `InstanceID`.\n- Server-side code if your client app requires that functionality.\n\nThe Instance ID service notifies your app of an `InstanceID` reset via\ncallback to a `InstanceIDListenerService`. If your app receives this\nnotification, it must call `getToken()` and retrieve the new `InstanceID`,\nand update its servers.\n\nUse the `getToken` method to prove the ownership of the `InstanceID` and to allow\nservers to access data or services associated with the app. The method follows\nthe patterns of OAuth2, and requires an `authorizedEntity` and `scope`. The\n`authorizedEntity` can be a project ID or another `InstanceID`, and it determines\nthe services that are authorized to use the generated token. The `scope`\ndetermines the specific service or data to which the token allows access.\n\nLearn more about the Instance ID API for:\n\n[Android](/instance-id/reference/android/api)\n[iOS](/instance-id/reference/ios/api)\n[Server](/instance-id/reference/server)"]]