查询云Firestore时反应本机错误

时间:2020-08-28 15:25:12

标签: javascript firebase react-native react-native-android react-native-firebase

因此,我正在关注this doc,以便从android的React Native应用中查询Cloud Firestore。我能够登录我的用户,因此与服务器的交互似乎正常。 但是,在执行以下代码段时,

import auth from "@react-native-firebase/auth";
import firestore from "@react-native-firebase/firestore";

/*other code*/

const user = auth().currentUser;
firestore()
    .collection("users")
    .doc(user.uid)
    .get()
    .then((documentSnapshot) => {
      console.log("User exists: ", documentSnapshot.exists);

      if (documentSnapshot.exists) {
        console.log("User data: ", documentSnapshot.data());
      }
    });

我收到以下错误:

enter image description here

0 个答案:

没有答案