Play Games Hizmetleri geri çağırma özelliğini uygulamanıza entegre etme
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Kendi hesap sisteminizi kullanmaya devam ederken kullanıcıları oyununuzda sorunsuz bir şekilde oturum açtırın. Play Games Hizmetleri Recall API'leri sayesinde oyun içi hesapları bir Google Play Games Hizmetleri hesabına bağlayabilirsiniz. Ardından, bir kullanıcı oyununuzu farklı cihazlarda (veya oyununuzu yeniden yükledikten sonra aynı cihazda) oynadığında bağlı oyun içi hesabı sorgular ve oturum açma akışını kolaylaştırırsınız.
Android Recall API'leriyle entegrasyon yaptıysanız bu Recall API'leri tanıdık gelecektir. Play Games Hizmetleri Geri Çağırma ile yapılan sunucu tarafı entegrasyonlar hem Android hem de PC'de aynı olduğundan PC oyunları tarafından yeniden kullanılabilir.
1. adım: Play Games Hizmetleri proje kimliğinizi manifest dosyasına ekleyin
Play Console'da Play Games Hizmetleri kurulumunu tamamladıktan sonra oyununuz artık ilişkili bir Play Games Hizmetleri proje kimliğine sahip olur. Play Console'daki Play Games Hizmeti'nin Yapılandırma sayfasında bulunan bu proje kimliğini kullanarak oyununuzun manifest.xml değerini güncelleyin.
Bu çağrı, arka uç tarafından oyun içi hesaplarınızı bir Play Games Hizmetleri kullanıcısıyla bağlamak ve bağlantılarını kaldırmak için Google'a sunucu tarafı çağrıları yapmak üzere kullanılan bir oturum kimliği döndürür.
autopromise=std::make_shared<std::promise<RecallAccessResult>>();games_recall_client.RequestRecallAccess(params,[promise](RecallAccessResultresult){promise->set_value(std::move(result));});autorecall_access_result=promise->get_future().get();if(recall_access_result.ok()){autorecall_session_id=recall_access_result.value().recall_session_id;// Pass the recall session ID to your backend game server so it can query// for an existing linked in-game account.// - If you discover an existing linked in-game account, continue to sign-in// the in-game account. This provides a seamless cross-device sign-in// experience.// - If there is not an existing linked in-game account, when the user// completes the sign-in using your in-game account system record the// account linking with Play Games Services Recall. This helps to provide// a seamless cross-device sign-in experience when the user returns on a// different device or after re-installing your game on the same device.}else{// Handle the error}
3. Adım: Hatırlatma oturumu kimliğini işleyin
Oyununuz Recall oturum kimliğini aldıktan ve arka uç oyun sunucunuza aktardıktan sonra Play Games sunucu tarafı REST API'lerini kullanarak şunları yapabilirsiniz:
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-07-26 UTC."],[],[],null,["# Integrate the Play Games Services Recall into your app\n\nSeamlessly sign users into your game while continuing to use your own account\nsystem. With Play Games Services Recall APIs you can link in-game accounts with\na Google Play Games Services account, then when a user plays your game across\ndifferent devices (or the same device after re-installing your game) you query\nthe linked in-game account and streamline the sign-in flow.\n\nIf you have integrated with the [Android Recall APIs](/games/pgs/recall/recall-setup), these\nRecall APIs should look familiar. Any server-side integrations with Play Games\nServices Recall can be reused by PC titles as they are the same across both\nAndroid \\& PC.\n\nPrerequisites\n-------------\n\n- Complete the [SDK setup](/games/playgames/native-pc/setup).\n\n- Read the overview of [Play Games Services Recall API](/games/pgs/recall).\n\n- Complete [Google Play Games Services setup](/games/pgs/console/setup) in the Play Console.\n\n**Step 1**: Add your Play Games Services project ID in the manifest\n-------------------------------------------------------------------\n\nAfter completing the Play Games Services setup in the Play Console, your game\nnow has an associated Play Games Services' project ID. Using this project ID,\nwhich can be found inside Play Games Service's\n[Configuration page](https://play.google.com/console/u/0/developers/app/games/configuration-summary) in the Play Console, update\nyour game's `manifest.xml`.\n\nExample `manifest.xml` contents: \n\n \u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n \u003cManifest version=\"1\"\u003e\n \u003cApplication\u003e\n \u003cPackageName\u003e\u003cvar translate=\"no\"\u003ecom.example.package\u003c/var\u003e\u003c/PackageName\u003e\n \\\u003cPlayGamesServices\\\u003e\n \\\u003cProjectId\\\u003e\u003cvar translate=\"no\"\u003e123456789\u003c/var\u003e\\\u003c/ProjectId\\\u003e\n \\\u003c/PlayGamesServices\\\u003e\n \u003c/Application\u003e\n \u003c/Manifest\u003e\n\n**Step 2**: Request Recall access when signing-in\n-------------------------------------------------\n\n| **Tip:** We recommend using the Recall API to query for linked in-game accounts each time your game is launched. For new installs a linked in-game account can be used to seamlessly sign-in a user and restore their progress. For existing installs, when the linked in-game account changes it signals that the user switched accounts on a different device and you can save them time by switching to that account.\n\nWhen your game is handling a sign-in flow, for example adding an in-game\naccount, request Recall access using\n[`GamesRecallClient::RequestRecallAccess()`](/games/playgames/native-pc/reference/class/google/play/games/recall/games-recall-client#requestrecallaccess).\n\nThis call returns a session ID which is used by your backend to make server-side\ncalls to Google for linking \\& unlinking your in-game accounts with a Play Games\nServices user. \n\n auto promise = std::make_shared\u003cstd::promise\u003cRecallAccessResult\u003e\u003e();\n games_recall_client.RequestRecallAccess(params, [promise](RecallAccessResult result) {\n promise-\u003eset_value(std::move(result));\n });\n\n auto recall_access_result = promise-\u003eget_future().get();\n if (recall_access_result.ok()) {\n auto recall_session_id = recall_access_result.value().recall_session_id;\n // Pass the recall session ID to your backend game server so it can query\n // for an existing linked in-game account.\n // - If you discover an existing linked in-game account, continue to sign-in\n // the in-game account. This provides a seamless cross-device sign-in\n // experience.\n // - If there is not an existing linked in-game account, when the user\n // completes the sign-in using your in-game account system record the\n // account linking with Play Games Services Recall. This helps to provide\n // a seamless cross-device sign-in experience when the user returns on a\n // different device or after re-installing your game on the same device.\n } else {\n // Handle the error\n }\n\n**Step 3**: Process the Recall session ID\n-----------------------------------------\n\nOnce your game has the Recall session ID and has passed it to you backend game\nserver, use the [Play Games server-side REST APIs](/games/services/web/api/rest/v1/recall) to:\n\n- Querying for existing linked in-game accounts using [`recall.retrieveTokens`](/games/services/web/api/rest/v1/recall/retrieveTokens)\n- Add or update linked in-game accounts using [`recall.linkPersona`](/games/services/web/api/rest/v1/recall/linkPersona)\n- Delete linked in-game accounts using [`recall.unlinkPersona`](/games/services/web/api/rest/v1/recall/unlinkPersona)\n\nFor a more detailed guide covering the server-side integration see the\ndocumentation covering how to\n[use the Recall API within your game server](/games/pgs/recall/recall-setup#using-recall)."]]