概览
“概览”章节用于 Firebase Authentication 的 Capacitor 插件
从 applyActionCode() 以及下方列出的其他核心方法。
平台支持
标题为“平台支持”的部分| 平台 | 支持 | 备注 |
|---|---|---|
| iOS | 是 | 原生 |
| Android | 是 | 原生 |
| Web 端 | 否 | 使用 Capacitor.getPlatform() 做保护 |
核心功能
标题为“核心功能”的章节applyActionCode- 应用通过邮件发送给用户用于验证的 code。confirmPasswordReset- 完成密码重置流程。confirmVerificationCode- 完成手机号验证流程。createUserWithEmailAndPassword- 使用邮箱和密码创建新用户账号。如果新账号创建成功,用户会自动登录。
公开 API
标题为“公开 API”的章节| 方法 | 描述 |
|---|---|
applyActionCode | 应用通过邮件发送给用户的验证 code。 |
confirmPasswordReset | 完成密码重置流程。 |
confirmVerificationCode | 完成手机号验证流程。 |
createUserWithEmailAndPassword | 使用邮箱和密码创建新用户账号。如果新账号创建成功,用户会自动登录。 |
deleteUser | 删除用户并退出登录。 |
fetchSignInMethodsForEmail | 获取某个邮箱地址的登录方式。 |
getCurrentUser | 获取当前已登录的用户信息。 |
getPendingAuthResult | 返回 SignInResult 如果您的应用启动了 Web 登录流程,而操作系统在后台清理了该应用。 |
getIdToken | 获取当前登录用户的 Firebase Auth ID Token。 |
getIdTokenResult | 返回反序列化后的 JSON Web Token (JWT),用于在 Firebase 服务中标识用户。 |
getRedirectResult | 返回 SignInResult (来自基于重定向的登录流程)。 |
getTenantId | 获取租户 ID。 |
isSignInWithEmailLink | 检查传入链接是否为适用于……的电子邮件链接登录 signInWithEmailLink. |
linkWithApple | 将用户账号与 Apple 身份验证提供商绑定。 |
linkWithEmailAndPassword | 将用户账号与 Email 身份验证提供商绑定。 |
linkWithEmailLink | 将用户账号与 Email 身份验证提供商绑定。 |
linkWithFacebook | 将用户账号与 Facebook 身份验证提供商绑定。 |
linkWithGameCenter | 将用户账号与 Game Center 身份验证提供商关联。 |
linkWithGithub | 将用户账号与 GitHub 身份验证提供商关联。 |
linkWithGoogle | 将用户账号与 Google 身份验证提供商关联。 |
linkWithMicrosoft | 将用户账号与 Microsoft 身份验证提供商关联。 |
linkWithOpenIdConnect | 将用户账号与 OpenID Connect 提供商关联。 |
linkWithPhoneNumber | 将用户账号与手机号身份验证提供商关联。 |
linkWithPlayGames | 将用户账号与 Play Games 身份验证提供商关联。 |
linkWithTwitter | 将用户账号与 Twitter 身份验证提供商关联。 |
linkWithYahoo | 将用户账号与 Yahoo 身份验证提供商关联。 |
reload | 如果已登录,则重新加载用户账号数据。 |
revokeAccessToken | 撤销指定的 access token。目前仅支持 Apple OAuth access token。 |
sendEmailVerification | 向当前已登录用户发送验证邮件。 |
sendPasswordResetEmail | 发送密码重置邮件。 |
sendSignInLinkToEmail | 向指定邮箱的用户发送登录邮件链接。 |
setLanguageCode | 设置身份验证操作面向用户的语言 code。 |
setPersistence | 设置当前已保存的身份验证会话的持久化类型。 |
setTenantId | 设置租户 ID。 |
signInAnonymously | 以匿名用户身份登录。 |
signInWithApple | 启动 Apple 登录流程。 |
signInWithCustomToken | 启动 Custom Token 登录流程。 |
signInWithEmailAndPassword | 启动邮箱和密码登录流程。 |
signInWithEmailLink | 使用邮箱和登录邮件链接登录。 |
signInWithFacebook | 启动 Facebook 登录流程。 |
signInWithGameCenter | 启动 Game Center 登录流程。 |
signInWithGithub | 启动 GitHub 登录流程。 |
signInWithGoogle | 启动 Google 登录流程。 |
signInWithMicrosoft | 启动 Microsoft 登录流程。 |
signInWithOpenIdConnect | 启动 OpenID Connect 登录流程。 |
signInWithPhoneNumber | 使用电话号码启动登录流程。 |
signInWithPlayGames | 启动 Play Games 登录流程。 |
signInWithTwitter | 启动 Twitter 登录流程。 |
signInWithYahoo | 启动 Yahoo 登录流程。 |
signOut | 启动登出流程。 |
unlink | 将提供商从用户账户中解绑。 |
updateEmail | 更新当前登录用户的电子邮件地址。 |
updatePassword | 更新当前登录用户的密码。 |
updateProfile | 更新用户个人资料数据。 |
useAppLanguage | 将面向用户的语言 code 设置为应用的默认语言。 |
useEmulator | 配置应用以连接 Authentication 模拟器。 |
verifyBeforeUpdateEmail | 先验证新邮箱地址,再更新当前登录用户的邮箱地址。 |
checkAppTrackingTransparencyPermission | 检查应用追踪透明度(App Tracking Transparency)的当前状态。 |
requestAppTrackingTransparencyPermission | 打开系统对话框以授权应用追踪透明度。 |
addListener | 监听用户登录状态的变化。 |
addListener | 监听当前登录用户的 ID token 变化。 |
addListener | 监听手机号验证完成的事件。 |
addListener | 监听手机号验证失败的事件。 |
addListener | 监听手机号验证 code。 |
removeAllListeners | 移除该插件的所有监听器。 |
getPluginVersion | 获取此插件的版本。 |
单一事实来源
标题为“单一事实来源”的部分此参考文档同步自 src/definitions.ts 中的 capacitor-firebase.
从 @capgo/capacitor-firebase-authentication 继续
标题为“从 @capgo/capacitor-firebase-authentication 继续”的章节如果你正在使用 @capgo/capacitor-firebase-authentication 用来规划身份验证和账户流程,并将它与 @capgo/capacitor-social-login 在 @capgo/capacitor-social-login 中查看实现细节, @capgo/capacitor-passkey 有关 @capgo/capacitor-passkey 的实现细节, @capgo/capacitor-native-biometric 有关 @capgo/capacitor-native-biometric 的实现细节, 双因素认证 有关双因素认证的实现细节,以及 SSO (企业版) 有关 SSO (Enterprise) 的实现细节。