使用SDK或REST API在Firebase后端摇动? [英] Flutter with firebase backend, using SDK or REST API?

查看:84
本文介绍了使用SDK或REST API在Firebase后端摇动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用flutter和Firebase作为后端来构建某种超级应用程序,例如app.我从互联网上找到的一些教程中,通过使用REST API学习了如何将flutter与firebase结合使用.他决定使用REST API进行授课,这样,如果您想使用Firebase之外的其他后端,除了他教的内容之外,还可以.

i am building some kind of uber like apps using flutter with firebase as the backend. I learn using flutter with firebase by using REST API from some tutorial i find on the internet. He decided to teach using REST API so that if you want to use other backend beside firebase than what he teach still viable.

但是我想知道,有什么不同?如果您毕竟只是使用Firebase,那么使用Firebase SDK有什么好处?

But i wonder, whats the different? what is the benefits of using firebase SDK if you are going just using firebase after all?

通过使用Firebase SDK可以获得脱机同步功能吗?

and is it by using firebase SDK i can get offline sync features?

推荐答案

确切的答案取决于您所使用的Firebase产品(在撰写本文时,其中有18种产品),您的具体用途-情况,实施方式以及个人喜好.但我会给出一些粗略的指导.考虑到您提到的离线同步,我假设您使用的是实时数据库或Cloud Firestore.

The precise answer depends on which Firebase product(s) you're using (as there are 18 of them at this point of writing), your specific use-case, how you implement it, and personal preference. But I'll give some rough guidance. Given your mention of offline sync, I'm going to assume you use either the Realtime Database, or Cloud Firestore.

Firebase SDK包含许多代码来处理脱机存储,管理连接性,在客户端脱机时管理读写操作等等.如果这种行为对您很重要,并且您正在使用REST API,则必须自己编写行为的代码.那是否值得您花时间,只有您能说出来.我个人仅在需要针对没有Firebase SDK可用的平台的情况下才使用REST API.

The Firebase SDKs contain a lot of code to handle offline storage, managing connectivity, managing read and write operations while the client is offline, and much more. If such behavior is important to you and you're using the REST API, you will have to write the code for the behavior yourself. Whether that is worth your time, only you can tell. I personally only use the REST API if I need to target a platform for which there's no Firebase SDK available.

这篇关于使用SDK或REST API在Firebase后端摇动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆