草庐IT

cloud-firestore

全部标签

ios - 无法到达 Firestore 后端

我正在创建一个swift4ios应用程序,并想使用Firestore来存储我的所有数据。我已经阅读了入门指南并观看了在线教程,但我仍然收到错误消息:"4.8.1-[Firebase/Firestore][I-FST000001]CouldnotreachFirestorebackend."我的cocoapods文件包含:pod'Firebase/Core'pod'Firebase/Auth'pod'Firebase/Firestore'在AppDelegate中:我导入Firebase并在didFinishLaunchingWithOptions中我做FirebaseApp.confi

swift - Firestore 搜索数组包含多个值

如果我有一个简单的集合,例如:Fruits:Banana:title:"Banana"vitamins:["potassium","B6","C"]Apple:title:"Apple"vitamins:["A","B6","C"]如果我想搜索含有维生素B6的水果,我会执行以下操作:db.collection("Fruits").whereField("vitamins",arrayContains:"A").getDocuments(){(querySnapshot,err)inifleterr=err{print("Errorgettingdocuments:\(err)")}el

ios - 如何在 Swift 中从 Cloud FireStore Firebase 访问特定字段

这是我的数据结构:我有一个iOS应用试图从CloudFirestore访问数据。我已成功检索完整文档并查询文档。但是我需要访问特定文档中的特定字段。我将如何进行调用以快速从Firestore中检索一个字段的值?任何帮助,将不胜感激。 最佳答案 没有任何API可以使用任何Web或移动客户端SDK从文档中提取单个字段。当您使用getDocument()时,始终会提取整个文档.这意味着也没有办法使用安全规则来保护文档中与其他字段不同的单个字段。如果您想尽量减少通过网络传输的数据量,您可以将那个单独的字段放在主文档的子集合中它自己的文档中,

java - Cloud Endpoints 自定义域解决方法

我们有一个AppEngine应用程序,我们希望将其与GoogleEndpoints一起使用。我们需要支持Web客户端和移动客户端,这正是Endpoints对我们有吸引力的原因,因为我们可以轻松生成Android和iOS客户端API。问题是云端点当前don'tsupportcustomdomains,因此我们的Web客户端无法直接与端点通信(移动客户端没有此问题)。这是我们已经尝试过的:从客户端到appspot.com域的CORS请求。这样做的问题是因为我们的请求不满足简单CORS(自定义header、cookie等)的要求,每个请求都必须发送预检请求,这会减慢一切客户端向我们的自定义域

java - HttpURLConnection PUT 到 Google Cloud Storage 给出错误 403

我尝试使用XMLAPI将文件上传到GoogleCloudStorage。我为每次上传生成了正确的GoogleAccessId、到期日期和签名。奇怪的是我可以使用Postman(Chrome应用程序)PUT文件,所以我确定URL没问题。我只是不能使用我的AndroidJava程序PUT它(它返回给我403错误)。执行上传的源代码在这里(它基于这个:https://cloud.google.com/storage/docs/access-control#Signing-Strings):URLurl;HttpURLConnectionconnection;try{url=newURL("h

java - 通过签名 URL 将文件放入 Google Cloud Storage (GCS)

我正在尝试使用“签名URL”来访问/上传文件到GoogleCloudStorage(GCS)。按照https://developers.google.com/storage/docs/accesscontrol#Signing-Strings中的说明进行操作我做了什么:在GoogleCloudConsole注册了一个“Web应用程序”。在已注册的Web应用程序屏幕的“证书”部分使用“生成新key”生成新的私钥。创建了我的要签名的字符串,并使用页面“如何签名”部分提供的示例代码对其进行签名(只是对Java主程序的硬编码值进行了细微调整)。更新:为GcsSigner.java创建了要点.确

java - Firebase Firestore : How to convert document object to a POJO on Android

使用实时数据库,可以做到这一点:MyPojopojo=dataSnapshot.getValue(MyPojo.Class);作为一种映射对象的方法,如何使用Firestore来实现这一点?代码:FirebaseFirestoredb=FirebaseFirestore.getInstance();db.collection("app/users/"+uid).document("notifications").get().addOnCompleteListener(task->{if(task.isSuccessful()){DocumentSnapshotdocument=task

java - 为什么我得到 "Project facet Cloud Foundry Standalone Application version 1.0 is not supported"?

我正在尝试从IBMdeveloperWorks部署以下项目至Bluemix:BuildingaJavaEEapponIBMBluemixUsingWatsonandCloudant通过Eclipse中的Bluemix插件(称为:IBMEclipseToolsforBluemix)。但是我不断收到以下错误ProjectfacetCloudFoundryStandaloneApplicationversion1.0isnotsupported使用的版本:Eclipse版本:MarsRelease(4.5.0)Buildid:20150621-1200IBM®EclipseToolsforB

android - 在 Android 上处理 Google Cloud Messaging 中的注册 ID 更改

在GoogleCloudMessaging的文档中,它指出:TheAndroidapplicationshouldstorethisIDforlateruse(forinstance,tocheckononCreate()ifitisalreadyregistered).NotethatGooglemayperiodicallyrefreshtheregistrationID,soyoushoulddesignyourAndroidapplicationwiththeunderstandingthatthecom.google.android.c2dm.intent.REGISTRAT

android - 在 Android 上处理 Google Cloud Messaging 中的注册 ID 更改

在GoogleCloudMessaging的文档中,它指出:TheAndroidapplicationshouldstorethisIDforlateruse(forinstance,tocheckononCreate()ifitisalreadyregistered).NotethatGooglemayperiodicallyrefreshtheregistrationID,soyoushoulddesignyourAndroidapplicationwiththeunderstandingthatthecom.google.android.c2dm.intent.REGISTRAT