![](/img/trans.png)
[英]Firebase Passwordless Email Authentication doesn't open app on iOS
[英]RN Firebase: Request passwordless sign-in on mobile, open link on PC, get signed-in on mobile?
我已經在移動設備上成功設置了無密碼登錄流程(使用動態鏈接)。 只要登錄鏈接在同一移動設備上打開,它就可以在 iOS 和 Android 上運行。
我想支持用戶在手機上登錄,但在他們的 PC 上打開鏈接的場景。 這甚至可能嗎?
單擊 PC 上的鏈接時,我目前看到一個空白頁面,在我的ActionCodeSettings
中配置了 URL :
const actionCodeSettings: FirebaseAuthTypes.ActionCodeSettings = {
handleCodeInApp: true,
url: 'https://the-url-i-see',
iOS: {
bundleId: '...',
},
android: {
packageName: '...',
installApp: true,
},
}
我的末端缺少哪些部分?
更新
我又近了一步:我創建了一個index.html
以通過https://the-url-i-see
服務:
if (firebase.auth().isSignInWithEmailLink(window.location.href)) {
email = window.prompt('Please provide your email for confirmation');
firebase.auth().signInWithEmailLink(email, window.location.href).then(() => {
console.log('Sign-in successful')
}).catch(e => {
console.error('Sign-in failed', e)
})
}
現在有效:
index.html
還缺少什么:
移動應用程序不會收到有關登錄的通知(具體而言, onAuthStateChanged
處理程序未觸發)。
同時我了解到這不是 Firebase Auth 的工作方式。 我的新理解,過於簡化:
firebase.auth()
realm (將在此領域觸發onAuthStateChanged
)TL;DR:開箱即用不支持跨設備無密碼登錄
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.