React Native 和 Firestore

     2023-02-22     14

关键词:

【中文标题】React Native 和 Firestore【英文标题】:React Native and Firestore 【发布时间】:2020-05-20 00:09:27 【问题描述】:

我是 firebase 的初学者,在项目决策方面需要一些帮助。我正在为某人和我正在考虑使用 firebase 的数据库构建一个 react native 应用程序,但是当我浏览文档时,我意识到 firestore 提供后端服务,这是否意味着我不必为后端。我原本打算使用 Django,但如果 firestore 提供后端服务,它将为项目提供更多便利。谁能给我解释一下?

【问题讨论】:

【参考方案1】:

您确实可以将您的 ReactJS 应用程序直接连接到 Cloud Firestore,而无需您自己的服务器。为了保护应用程序,您可以使用 Firebase 的 server-side security rules,它允许您控制谁可以读取和写入哪些数据。这当然特别重要,因为您要打开数据库以便从客户端应用程序和 Internet 的其余部分直接访问。

为了从 React Native 访问 Firebase,许多开发人员使用 react-native-firebase library,它比 JavaScript SDK 封装了更多的 Firebase 服务。

【讨论】:

感谢弗兰克的回复。只是为了澄清,我不认为写任何后端代码是正确的。我只是应该在我的 react native 上集成 firestore。另外,虽然我有机会问,firebase 和 firestore 有什么区别? Firebase 是一个拥有 18 个产品的平台,其中两个是数据库。一个数据库是实时数据库,它也是 Firebase 的原始产品。另一个数据库是 Cloud Firestore,它的创建是为了解决实时数据库的一些可扩展性限制(当然是为了自己的限制进行交易)。如果您想了解更多关于不同之处以及使用哪一个的信息,请查看***.com/questions/46549766/…

再次删除带有文档和集合的集合(firestore react native)

】再次删除带有文档和集合的集合(firestorereactnative)【英文标题】:deleteacollectionwithdocumentandcollectionagaininside(firestorereactnative)【发布时间】:2021-11-2302:08:19【问题描述】:我无法在Firestore上删除这是我的删除varchatId=route.params.nu... 查看详情

React-Native Firestore - 获取评论部分的用户信息

】React-NativeFirestore-获取评论部分的用户信息【英文标题】:React-NativeFirestore-Getuserinfoforacommentsection【发布时间】:2022-01-1612:13:34【问题描述】:我正在使用react-native和react-native-firebase构建应用程序,但在尝试实现评论部分时遇... 查看详情

React Native Firebase:如何显示 Firestore 中的文本?

】ReactNativeFirebase:如何显示Firestore中的文本?【英文标题】:ReactNativeFirebase:HowcanyoudisplayatextfromFirestore?【发布时间】:2021-07-2620:26:22【问题描述】:我正在尝试使用Reactnative、Firebase和Expo制作一个应用程序,该应用程序显示从Fi... 查看详情

添加数据后,我从 Firestore 获得重复数据。在 React Native 中

】添加数据后,我从Firestore获得重复数据。在ReactNative中【英文标题】:IgetduplicatedatafromFirestoreafteraddingdata.InReactNative【发布时间】:2022-01-1817:36:47【问题描述】:我正在为我的应用程序使用ReactNative和Firestore。我使用onSnapshot()从... 查看详情

React Native 客户端和管理节点服务器上的 FirebaseFirestore.Timestamp 与 firebase.firestore.Timestamp

】ReactNative客户端和管理节点服务器上的FirebaseFirestore.Timestamp与firebase.firestore.Timestamp【英文标题】:FirebaseFirestore.Timestampvsfirebase.firestore.TimestamponReactNativeclientandAdminNodeserver【发布时间】:2020-12-2322:54:21【问题描述】:我正在尝... 查看详情

无法从 React-Native-Firebase(v6) Firestore 获取数据:未定义不是函数(靠近 '...this._firestore.native.collectionGet...'

】无法从React-Native-Firebase(v6)Firestore获取数据:未定义不是函数(靠近\\\'...this._firestore.native.collectionGet...\\\')【英文标题】:Can\'tgetdatafromReact-Native-Firebase(v6)Firestore:undefinedisnotafunction(near\'...this._firestore.native.c 查看详情

将 Apple Sign In 与 React Native Firebase 和 Firestore 一起使用时,如何检查用户是不是存在?

】将AppleSignIn与ReactNativeFirebase和Firestore一起使用时,如何检查用户是不是存在?【英文标题】:HowcanIcheckifUserexistswhenusingAppleSignInwithReactNativeFirebaseandFirestore?将AppleSignIn与ReactNativeFirebase和Firestore一起使用时,如何检查用户是否存... 查看详情

React Native Parse Firestore 时间戳

】ReactNativeParseFirestore时间戳【英文标题】:ReactNativeParseFirestoreTimestamp【发布时间】:2018-10-2217:16:08【问题描述】:我意识到关于如何在react中解析firebase/firestore时间戳的文档绝对是0。如此处所示https://firebase.google.com/docs/reference/... 查看详情

React Native to firestore:Firestore(8.2.1):连接WebChannel传输错误

】ReactNativetofirestore:Firestore(8.2.1):连接WebChannel传输错误【英文标题】:ReactNativetofirestore:Firestore(8.2.1):ConnectionWebChanneltransporterrored【发布时间】:2021-04-1202:28:06【问题描述】:我创建了简单的ReactNative屏幕,可以将数据存储... 查看详情

Cloud Firestore 是不是支持 React Native

】CloudFirestore是不是支持ReactNative【英文标题】:DoesCloudFirestoresupportReactNativeCloudFirestore是否支持ReactNative【发布时间】:2018-03-1718:37:16【问题描述】:我目前在我的react-native移动应用程序中使用Firebase实时数据库,并且我一直在... 查看详情

React Native Firebase Cloud Firestore

】ReactNativeFirebaseCloudFirestore【英文标题】:【发布时间】:2018-11-1023:30:11【问题描述】:使用ReactNativeFirebaseBasicStarterKit我无法将数据添加到在Android模拟器中运行应用程序的云Firestore。我添加到项目中的唯一代码是在componentDidMoun... 查看详情

firestore 不适用于 React Native Expo

】firestore不适用于ReactNativeExpo【英文标题】:firestoreisnotworkingwithReactNativeExpo【发布时间】:2021-08-1603:09:18【问题描述】:我使用expoaddfirebase安装了带有reactnativeexpo的firebase,然后我创建了一个文件(firebase.tsx)并添加了Firebase配置... 查看详情

React Native重复超时将集合写入firestore@firebase/firestore:Firestore(8.4.2):连接WebChannel传输错误

】ReactNative重复超时将集合写入firestore@firebase/firestore:Firestore(8.4.2):连接WebChannel传输错误【英文标题】:ReactNativerepeatedtimeoutswritingcollectiontofirestore@firebase/firestore:Firestore(8.4.2):ConnectionWebChanneltransporterrored【发 查看详情

react-native:firestore - 如何从存储桶引用中获取文件夹名称?

】react-native:firestore-如何从存储桶引用中获取文件夹名称?【英文标题】:react-native:firestore-Howtogetfoldernamesfromstoragebucketref?【发布时间】:2020-11-2506:02:20【问题描述】:如果我需要从文件夹中获取图片url,那么我会执行以下操... 查看详情

如何修复 React Native 中的 Firebase/firestore 错误?

】如何修复ReactNative中的Firebase/firestore错误?【英文标题】:HowcanIfixFirebase/firestoreerrorinReactnative?【发布时间】:2019-11-0120:19:38【问题描述】:我正在尝试在Android模拟器上运行ReactNative应用程序。我正在使用FirebaseFirestore。该应用... 查看详情

在 React Native 中添加新消息时,Firestore 侦听器从分页中删除消息

】在ReactNative中添加新消息时,Firestore侦听器从分页中删除消息【英文标题】:FirestorelistenerremovesamessagefrompaginationwhenaddinganewmessageinReactNative【发布时间】:2021-10-0700:32:13【问题描述】:我正在尝试进行Firestore反应式分页。我知... 查看详情

通过 Firebase 访问 Firestore 超时(React Native 应用程序)

】通过Firebase访问Firestore超时(ReactNative应用程序)【英文标题】:FirestoreaccessviaFirebasetimesout(ReactNativeapp)【发布时间】:2021-09-1810:57:45【问题描述】:我有一个使用Expo构建的ReactNative应用程序。在启动时,它连接到Firestore并尝试... 查看详情

如何使用 React-Native 在 Firestore 中获取包含特定字符串的数组的文档

】如何使用React-Native在Firestore中获取包含特定字符串的数组的文档【英文标题】:HowtogetdocumentswitharraycontainingaspecificstringinFirestorewithReact-Native【发布时间】:2018-09-1722:15:28【问题描述】:我刚刚开始使用Firebase,正在尝试确定如... 查看详情