Dịch vụ nhận dạng của Google đang di chuyển sang API FedCM. Làm theo hướng dẫn di chuyển để xem xét những thay đổi có thể xảy ra và tránh tác động tiêu cực đến việc người dùng đăng nhập vào trang web của bạn.
bookmark_borderbookmark
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Nếu muốn, bạn chỉ có thể sử dụng mã JavaScript để kích hoạt lời nhắc Một lần nhấn hoặc hiển thị nút Đăng nhập bằng Google.
Để định cấu hình lời nhắc Một lần nhấn trong JavaScript, trước tiên, bạn cần gọi phương thức initialize(). Sau đó, hãy gọi phương thức prompt() để hiển thị giao diện người dùng của lời nhắc. Hãy xem đoạn mã sau:
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 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."]]],[]]