فراخوان خدمات بازی های Play را در برنامه خود ادغام کنید
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
در حالی که همچنان به استفاده از سیستم حساب شخصی خود ادامه می دهید، کاربران را به صورت یکپارچه وارد بازی خود کنید. با استفاده از APIهای «خدمات بازیهای Play» میتوانید حسابهای درونبازی را با حساب «خدمات بازیهای Google Play» پیوند دهید، سپس وقتی کاربری بازی شما را در دستگاههای مختلف (یا همان دستگاه پس از نصب مجدد بازیتان) انجام میدهد، حساب مرتبط درون بازی را جستجو میکنید و جریان ورود به سیستم را ساده میکنید.
اگر با APIهای Recall Android ادغام شدهاید، این Recall APIها باید آشنا به نظر برسند. هر ادغام سمت سرور با Play Games Services Recall میتواند توسط عناوین رایانههای شخصی استفاده مجدد شود، زیرا در Android و PC یکسان هستند.
مرحله ۱ : شناسه پروژه خدمات بازیهای Play خود را در مانیفست اضافه کنید
پس از تکمیل راهاندازی خدمات بازیهای Play در کنسول Play، بازی شما اکنون دارای شناسه پروژه مرتبط با خدمات بازیهای Play است. با استفاده از این شناسه پروژه، که در صفحه پیکربندی سرویس بازیهای Play در کنسول Play یافت میشود، manifest.xml بازی خود را بهروزرسانی کنید.
مرحله 2 : هنگام ورود به سیستم درخواست دسترسی فراخوان دهید
هنگامی که بازی شما یک جریان ورود به سیستم را مدیریت می کند، به عنوان مثال یک حساب درون بازی اضافه می کند، با استفاده از GamesRecallClient::RequestRecallAccess() درخواست دسترسی به فراخوانی کنید.
این تماس یک شناسه جلسه را برمیگرداند که توسط باطن شما برای برقراری تماسهای سمت سرور با Google برای پیوند و لغو پیوند حسابهای درون بازی شما با یک کاربر خدمات بازیهای Play استفاده میشود.
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}
تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","easyToUnderstand","thumb-up"],["مشکلم را برطرف کرد","solvedMyProblem","thumb-up"],["غیره","otherUp","thumb-up"]],[["اطلاعاتی که نیاز دارم وجود ندارد","missingTheInformationINeed","thumb-down"],["بیشازحد پیچیده/ مراحل بسیار زیاد","tooComplicatedTooManySteps","thumb-down"],["قدیمی","outOfDate","thumb-down"],["مشکل ترجمه","translationIssue","thumb-down"],["مشکل کد / نمونهها","samplesCodeIssue","thumb-down"],["غیره","otherDown","thumb-down"]],["تاریخ آخرین بهروزرسانی 2025-07-29 بهوقت ساعت هماهنگ جهانی."],[],[],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)."]]