我是Flutter的新手,只是想知道是否可能.
我尝试使用intellij和给定的指令(https://flutter.io/setup/)构建演示代码.它在Android设备上运行良好,但找不到在我的iOS设备上编译和运行的选项.
Firebase Cloud Function 中是否可以通过字段和数据查询文档 ID?
在 Android 中,我会做这样的事情:
FirebaseFirestore fs = FirebaseFirestore.getInstances();
static final String mInterfaceId = "57ZNmAIldUPAc6ZWggvF";
fs.collection("users").whereEqualTo("interface_id", mInterfaceId).get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
for(DocumentSnapshot doc : task.getResult())
userId[0] = doc.getId();
if(userId.length==0)
Log.e("Error: ID Not found");
else
if(userId.length>1)
Log.e("Error: More than one ID found");
else
// Continue Process with Found ID
}
});
Run Code Online (Sandbox Code Playgroud)
提前致谢!