我在 react-native 中遇到错误,This Browser is not supported
,在iOS模拟器中,运行以下代码后:
const firebase = require('firebase')
const firebaseConfig = require('./firebase-config')
firebase.initializeApp(firebaseConfig)
firebase.database().ref('test').set('hello')
firebase-config 包含一个 databaseURL。
为什么?
最佳答案
Firebaser 在这里
由于依赖于 window
,新的 Firebase 身份验证目前在 React Native 中不起作用目的。我们正在寻找这是否是我们可以改进的地方,但不能保证。
来自 Jacob's post on the firebase-talk list :
As a "workaround" if you don't need auth (unlikely, I know, but still worth mentioning), you should be able to do the following:
var app = require('firebase/app');
var database = require('firebase/database');
关于firebase - iOS 模拟器不支持此浏览器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37500106/