![](/img/trans.png)
[英]How to Use Firebase Phone Authentication without recaptcha in React Native
[英]How to use Firebase Authentication in Vue Native
我将Vue Native与Firebase结合使用,并尝试使Firebase Auth正常工作。
但是,我不能。
我收到此错误消息。
在运行该应用程序的环境中不支持此操作。 location.protocol
我使用Firebase Web SDK。
$ yarn add firebase
而且我知道此错误消息的含义。
此应用程序是本机应用程序,当然不能在http / https上运行。
那么,如何在Vue Native中使用Firebase?
提前致谢。
我的代码在这里↓
<template>
<view class="container">
<button
:on-press="signInWithGoogle"
title="Sign In"
color="#841584"
/>
</view>
</template>
<script>
import firebase from 'firebase';
const config = {
apiKey: "API-KEY",
authDomain: "authDomain",
databaseURL: "databaseURL",
projectId: "projectId",
storageBucket: "storageBucket",
messagingSenderId: "messagingSenderId"
};
const app = firebase.initializeApp(config);
const provider = new firebase.auth.GoogleAuthProvider();
export default {
methods: {
signInWithGoogle() {
firebase.auth().signInWithRedirect(provider);
}
}
}
您可以使用react-native-firebase 。
您可以使用纱安装
yarn add react-native-firebase
并开始使用此处记录的API。
初始化项目时,应使用--no-crna。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.