Google পরিচয় পরিষেবাগুলি FedCM APIগুলিতে স্থানান্তরিত হচ্ছে৷ সম্ভাব্য পরিবর্তনগুলি পর্যালোচনা করতে এবং আপনার ওয়েবসাইটে ব্যবহারকারীর সাইন-ইন করার জন্য নেতিবাচক প্রভাব এড়াতে মাইগ্রেশন গাইড অনুসরণ করুন৷
প্রম্পট UI স্ট্যাটাস বিজ্ঞপ্তি পেতে, prompt() পদ্ধতিতে একটি কলব্যাক ফাংশন প্রদান করুন। নিম্নলিখিত কোড স্নিপেট দেখুন:
<script>
window.onload = function () {
google.accounts.id.initialize({
client_id: 'YOUR_GOOGLE_CLIENT_ID',
callback: handleCredentialResponse
});
google.accounts.id.prompt((notification) => {
if (notification.isNotDisplayed() || notification.isSkippedMoment()) {
// try next provider if OneTap is not displayed or skipped
}
});
}
</script>
নিচের উদাহরণ কোডটি জাভাস্ক্রিপ্টে কীভাবে ওয়ান ট্যাপ এবং সাইন ইন Google বোতাম দিয়ে রেন্ডার করতে হয় তা দেখায়।
[[["সহজে বোঝা যায়","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"]],["2024-11-23 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["Developers can customize the default login flow using JavaScript to better suit their specific needs."],["You can trigger the One Tap prompt or display the Sign in with Google button programmatically using JavaScript."],["The `initialize()` and `prompt()` methods are key to configuring and displaying the One Tap prompt in your web application."],["To receive updates on the prompt's status, such as if it's not displayed or skipped by the user, a callback function can be provided to the `prompt()` method."],["JavaScript allows for rendering both the One Tap prompt and the Sign in with Google button, offering users flexible login options."]]],[]]