使用google firebase,cordova,vuejs登录时出错

问题描述 投票:0回答:1

美好的一天,我正在尝试使用谷歌和我的config.xml文件登录我这样做

<?xml version='1.0' encoding='utf-8'?>
<widget id="com.terabit.facilpark" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <hook src="hooks/hookers.js" type="before_prepare" />
    <hook src="hooks/beforedep.js" type="before_deploy" />
    <name>FacilPark</name>
    <description>
    </description>
    <preference name="AndroidLaunchMode" value="singleTask" />
    <universal-links>
        <host name="facilpark19.page.link" scheme="https" />
        <host name="facilpark-bdfd1.firebaseapp.com" scheme="https">
            <path url="/__/auth/callback" />
        </host>
    </universal-links>
    <author email="[email protected]" href="http://cordova.io">
        Terabit
    </author>
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
    <allow-navigation href="*" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="cordova-plugin-buildinfo" spec="^2.0.2" />
    <plugin name="cordova-plugin-browsertab" spec="^0.2.0" />
    <plugin name="cordova-plugin-inappbrowser" spec="^3.0.0" />
    <plugin name="cordova-plugin-customurlscheme" spec="^4.3.0">
        <variable name="URL_SCHEME" value="com.terabit.facilpark" />
    </plugin>
    <plugin name="cordova-universal-links-plugin" spec="~1.2.1" />
    <plugin name="cordova-plugin-geolocation" spec="^4.0.1" />
    <plugin name="cordova.plugins.diagnostic" spec="^4.0.10" />
    <plugin name="cordova-open-native-settings" spec="^1.5.2" />
    <plugin name="cordova-plugin-device" spec="^2.0.2" />
    <engine name="browser" spec="^5.0.2" />
    <engine name="android" spec="^7.0.0" />
</widget>

以下列方式启动会议的动机:

loginGoogle(){
        console.log("LOGIN GOOGLE");
         const provider = new firebase.auth.GoogleAuthProvider();
         firebase.auth().signInWithRedirect(provider).then(function() {
          return firebase.auth().getRedirectResult();
        }).then(result =>{ 
            // This gives you a Google Access Token. You can use it to access the Google API.
            console.log("AUTENTICACION POR GOOGLE EXITOSA")
              this.completarInicio(user);

            //this.$router.replace('home');
            console.log(result);
            var token = result.credential.accessToken;
            // The signed-in user info.
            var user = result.user;
            // ...
          }).catch(function(error) {
            // Handle Errors here.
            var errorCode = error.code;
            var errorMessage = error.message;
            // The email of the user's account used.
            var email = error.email;
            // The firebase.auth.AuthCredential type that was used.
            var credential = error.credential;
            // ...
          });
      },

我的问题是从应用程序登录,选择谷歌帐户并输入密码后,我收到以下消息:enter image description here

我怎么能纠正上面提到的,非常感谢你。

vuejs2 firebase-authentication google-authentication
1个回答
0
投票

转到Firebase控制台,在项目概述页面上有一个名为Add App的非常小的按钮。选择操作系统,然后输入您的应用程序包ID。

© www.soinside.com 2019 - 2024. All rights reserved.