Uma*_*ain 5 android firebase firebase-authentication
我正在为 Android 实施 firebase 电子邮件链接身份验证机制。我已经使用 firebase 的指南实现了它。但是现在从电子邮件打开链接后,应用程序总是会转到启动器活动。我无法调试问题。我还在我的应用程序中实现了动态链接,效果很好。这是我的意图过滤器:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="www.example.com" />
<data android:pathPrefix="/emailSignInLink" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的 ActionCodeSetting:
ActionCodeSettings settings = ActionCodeSettings.newBuilder()
.setAndroidPackageName(
BuildConfig.APPLICATION_ID,
false, /* install if not available? */
null /* minimum app version */)
.setHandleCodeInApp(true)
.setUrl("https://www.example.com/emailSignInLink")
.build();
Run Code Online (Sandbox Code Playgroud)
谁能弄清楚我在这里做错了什么或遗漏了什么
来自 firebase 的示例:
https://github.com/firebase/quickstart-android/blob/master/auth/app/src/main/AndroidManifest.xml
编辑 1:
我通过在我的启动器活动的 onResume 数据中记录意图数据进行了检查,并且我正在获取 Firebase 身份验证返回的数据,所以我认为它看起来像是动态链接的某种问题。
我的 firebase 邀请版本是 15.0.0,因为 15.0.2 给了我错误(在文档中更新,但我认为没有实际发布。)
implementation "com.google.firebase:firebase-invites:15.0.0"
编辑 2: 将 firebase 示例用于无密码登录示例时,也存在同样的问题。我在 GitHub 上创建了一个问题
小智 3
我只是有和你一样的问题。为了解决这个问题,我删除了 pathPrefix 并设置了我的域的 url,而不是意图过滤器中的动态链接,它似乎有效。
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<data
android:scheme="https"
android:host="myfirebaseId.firebaseapp.com"/>
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
希望它会有所帮助
| 归档时间: |
|
| 查看次数: |
1363 次 |
| 最近记录: |