此代码会根据模拟器的要求保存到 Firebase 数据库,但不会在设备上调用完成处理程序。有谁知道为什么或可能的修复?
var customersRef : FIRDatabaseReference {
return dbRef.child("customers")
}
func saveDealData(dealBuilder: DealBuilder, errMsgHandler: ErrMsgHandler?) {
print("Shown in log in sim and device")
customersRef.child(u.id!).child("deals").childByAutoId().setValue("true") { error, dbRef in
print("Is called for sim but not device")
}
}
我已经尝试摆脱尾随闭包并将 setValue() 放入如下,但同样的情况发生了:
customersRef.child(u.id!).child("deals").childByAutoId().setValue("true", withCompletionBlock: { error, dbRef in
print("Is called in sim but not device")
})