সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
Google সাইন-ইন ক্লায়েন্ট শুরু হওয়ার পরে, আপনি হ্যান্ডলার সংযুক্ত করতে পারেন যা ব্যবহারকারীর সেশনের অবস্থা নির্ধারণ করতে ক্লায়েন্টের বিভিন্ন বৈশিষ্ট্য এবং পদ্ধতি পরীক্ষা করে। আপনি আপনার ব্যবহারকারীর জন্য একাধিক ট্যাব এবং ডিভাইস জুড়ে আপনার সাইটের ব্যবহারকারীর অভিজ্ঞতা সিঙ্ক করতে সাহায্য করতে ক্লায়েন্ট অবজেক্টের দ্বারা ফেরত দেওয়া তথ্য ব্যবহার করতে পারেন।
নিম্নলিখিত কোডটি 2.0 ক্লায়েন্ট মেথড attachClickHandler ব্যবহার করে একটি কলব্যাক তৈরি করতে দেখায় যা হয় নীরবে ব্যবহারকারীর জন্য সাইন-ইন শেষ করে, অথবা ব্যবহারকারীর সেশনের অবস্থার উপর ভিত্তি করে ব্যবহারকারীকে পুনরায় অনুমোদনের জন্য অনুরোধ করে।
/**
* The Sign-In client object.
*/
var auth2;
/**
* Initializes the Sign-In client.
*/
var initClient = function() {
gapi.load('auth2', function(){
/**
* Retrieve the singleton for the GoogleAuth library and set up the
* client.
*/
auth2 = gapi.auth2.init({
client_id: 'CLIENT_ID.apps.googleusercontent.com'
});
// Attach the click handler to the sign-in button
auth2.attachClickHandler('signin-button', {}, onSuccess, onFailure);
});
};
/**
* Handle successful sign-ins.
*/
var onSuccess = function(user) {
console.log('Signed in as ' + user.getBasicProfile().getName());
};
/**
* Handle sign-in failures.
*/
var onFailure = function(error) {
console.log(error);
};
[[["সহজে বোঝা যায়","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-01-09 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["The Google Sign-In JavaScript library is deprecated and will eventually be sunset; developers should consult the Deprecation and Sunset guide for migration details and timelines."],["Google Sign-In will require the use of FedCM APIs in the future, so developers should conduct an impact assessment to ensure their sign-in functionality remains unaffected."],["This page provides code demonstrating how to initialize the Google Sign-In client and attach click handlers to manage user sign-in and session state."],["Developers can utilize the `auth2` object to handle successful and failed sign-in attempts, accessing user information upon successful authentication."]]],[]]