我试图在我的项目中添加Firebase oauth,使用google和facebook。
我在我的项目中添加了插件:
现在我正在使用Android6.2.3作为我的平台,我正在考虑以后添加iOS。
我的问题是,我得到了每个登录请求使用firebase服务的响应,每个用户都会被取消/重定向。
我遵循了官方教程上的说明。我补充说:
<universal-links>
<host name="URL" scheme="https" />
<host name="package name" scheme="https">
<path url="/__/auth/callback" />
</host>
</universal-links>
进入我的config.xml文件。
发布于 2019-09-09 16:44:18
嗨,我花了5个小时才找到这个问题的解决方案。我正在使用PhoneGap构建。问题是通用链接标签没有复制到AndroidManifest.xml中.所以解决办法是
顶部的小部件标记中的添加
xmlns:android="http://schemas.android.com/apk/res/android"添加下面的代码在config.xml中的任何地方,我喜欢在插件之前或者在unvirsal标记旁边。
<config-file target="AndroidManifest.xml" parent="/manifest/application/activity">
<intent-filter android:autoVerify="true">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="****-***.firebaseapp.com" android:pathPrefix="/__/auth/callback" android:scheme="https" />
</intent-filter>
</config-file>现在,当应用程序是使用phonegapbuild或本地cordova CLI构建时,它会复制本应在清单文件中的通用链接数据。当应用程序运行并调用firebase.auth().getRedirectResult()时,它不会产生任何错误,比如
8月/被用户取消。重定向在最后定稿之前被用户取消了。
用户使用cordova CLI构建应用程序,请在运行cordova构建android之后,确保清单文件中的activity下面有上面的意图过滤器标签。
https://stackoverflow.com/questions/47836325
复制相似问题