আপনার নিজের অ্যাকাউন্ট সিস্টেম ব্যবহার করা চালিয়ে যাওয়ার সময় ব্যবহারকারীদের আপনার গেমে নির্বিঘ্নে সাইন-ইন করুন। Play Games Services Recall API-এর মাধ্যমে আপনি ইন-গেম অ্যাকাউন্টকে Google Play Games Services অ্যাকাউন্টের সাথে লিঙ্ক করতে পারবেন, তারপর কোনও ব্যবহারকারী বিভিন্ন ডিভাইসে (অথবা আপনার গেম আবার ইনস্টল করার পরে একই ডিভাইসে) আপনার গেম খেললে, আপনি লিঙ্ক করা ইন-গেম অ্যাকাউন্ট কোয়েরি করতে এবং সাইন-ইন ফ্লো স্ট্রিমলাইন করতে পারবেন।
আপনি যদি Android Recall API-এর সাথে ইন্টিগ্রেট করে থাকেন, তাহলে এই Recall API পরিচিত বলে মনে হবে। Play Games Services Recall-এর সাথে যেকোনও সার্ভার-সাইড ইন্টিগ্রেশন পিসি (PC) টাইটেল দ্বারা আবার ব্যবহার করা যেতে পারে কারণ সেগুলি Android ও পিসি (PC) উভয় ক্ষেত্রেই একই রকম।
পূর্বশর্ত
SDK সেট-আপ সম্পূর্ণ করুন।
Play Games Services Recall API-এর ওভারভিউ পড়ুন।
Play Console-এ Google Play Games Services সেট-আপ সম্পূর্ণ করুন।
ধাপ ১: ম্যানিফেস্টে আপনার Play Games Services প্রোজেক্ট আইডি যোগ করুন
Play Console-এ Play Games পরিষেবা সেট-আপ সম্পূর্ণ করার পরে, আপনার গেমের
এখন একটি সংশ্লিষ্ট Play Games পরিষেবার প্রোজেক্ট আইডি আছে। এই প্রোজেক্ট আইডি ব্যবহার করে,
যা Play Console-এ Play Games Service-এর
কনফিগারেশন পৃষ্ঠা-এর মধ্যে পাওয়া যাবে, আপনার গেমের manifest.xml আপডেট করুন।
উদাহরণ manifest.xml কন্টেন্ট:
<?xml version="1.0" encoding="utf-8"?>
<Manifest version="1">
<Application>
<PackageName>com.example.package</PackageName>
<PlayGamesServices>
<ProjectId>123456789</ProjectId>
</PlayGamesServices>
</Application>
</Manifest>
ধাপ ২: সাইন-ইন করার সময় Recall অ্যাক্সেসের অনুরোধ করা
আপনার গেম যখন সাইন-ইন ফ্লো ম্যানেজ করছে, যেমন, গেমের মধ্যে অ্যাকাউন্ট যোগ করা,
GamesRecallClient::RequestRecallAccess() ব্যবহার করে Recall অ্যাক্সেসের অনুরোধ করুন।
এই কলটি একটি সেশন আইডি রিটার্ন করে যা আপনার ব্যাকএন্ড দ্বারা Play Games পরিষেবা ব্যবহারকারীর সাথে আপনার ইন-গেম অ্যাকাউন্ট লিঙ্ক এবং আনলিঙ্ক করার জন্য Google-এ সার্ভার-সাইড কল করতে ব্যবহৃত হয়।
auto promise = std::make_shared<std::promise<RequestRecallAccessResult>>();
games_recall_client.RequestRecallAccess([promise](RequestRecallAccessResult result) {
promise->set_value(std::move(result));
});
auto recall_access_result = promise->get_future().get();
if (recall_access_result.ok()) {
auto recall_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
}
ধাপ ৩: Recall সেশন আইডি প্রসেস করা
আপনার গেম Recall সেশন আইডি পেয়ে গেলে এবং আপনার ব্যাকএন্ড গেম সার্ভারে এটি পাস করলে, Play Games সার্ভার-সাইড REST API ব্যবহার করে এগুলি করুন:
recall.retrieveTokensব্যবহার করে আগে থেকে লিঙ্ক করা ইন-গেম অ্যাকাউন্ট খোঁজা হচ্ছেrecall.linkPersonaব্যবহার করে লিঙ্ক করা ইন-গেম অ্যাকাউন্ট যোগ বা আপডেট করুনrecall.unlinkPersonaব্যবহার করে লিঙ্ক করা ইন-গেম অ্যাকাউন্ট মুছে দিন
সার্ভার-সাইড ইন্টিগ্রেশন কভার করে এমন আরও বিস্তারিত গাইডের জন্য, কীভাবে আপনার গেম সার্ভারের মধ্যে Recall API ব্যবহার করবেন তা কভার করে এমন ডকুমেন্টেশন দেখুন।