反应本机和Firebase 3 [英] React Native and Firebase 3
本文介绍了反应本机和Firebase 3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
从'../config'导入{FIREBASE_CONFIG};从firebase / app导入firebase;从firebase / database导入firebaseDatabase;从firebase / auth导入firebaseAuth; firebase.initializeApp(FIREBASE_CONFIG); export const rootRef = firebase.database();导出const authRef = firebase。 auth();
配置
module.exports = {FIREBASE_CONFIG:{apiKey:来自Firebase的长字符串,authDomain:xxxxx.firebaseapp.com,databaseURL:https:/ /xxxxx.firebaseio.com,storageBucket:xxxxx.appspot.com}}
但是...
我错过了什么?如果我是,你能指出我在正确的方向
config
$ ul
https://firebase.google.com/support/release-notes/js#3.1.0
I am trying to integrate React Native and Firebase 3 Authentication. My code.
import { FIREBASE_CONFIG } from '../config';
import firebase from 'firebase/app';
import firebaseDatabase from 'firebase/database';
import firebaseAuth from 'firebase/auth';
firebase.initializeApp(FIREBASE_CONFIG);
export const rootRef = firebase.database();
export const authRef = firebase.auth();
the config
module.exports = {
FIREBASE_CONFIG: {
apiKey: "long string from firebase",
authDomain: "xxxxx.firebaseapp.com",
databaseURL: "https://xxxxx.firebaseio.com",
storageBucket: "xxxxx.appspot.com"
}
}
But...
I'm I missing something? If I am, can you point me in the right direction config
- React Native 0.26.2
- Firebase 3.0.2
解决方案
The new release of firebase Javascript SDK 3.1.0 has React Native compatibility.
https://firebase.google.com/support/release-notes/js#3.1.0
这篇关于反应本机和Firebase 3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文