Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS中的Firebase push()_Ios_Firebase - Fatal编程技术网

iOS中的Firebase push()

iOS中的Firebase push(),ios,firebase,Ios,Firebase,iOS API是否有任何等效的Firebase.push()方法,可以在Javascript或Java API中使用 我在iOS的API参考中找不到它 我需要的是根据时间戳(我更喜欢服务器而不是客户端时间戳)将数据推送到新的子位置,并在块中返回该引用。是!我们将其重命名为更符合iOS命名约定,但其行为与ref.push()相同。如果您想设置数据(相当于ref.push(data)),可以执行[[ref childByAutoId]setValue:data]它在iOS上的行为似乎有所不同-在we

iOS API是否有任何等效的Firebase.push()方法,可以在Javascript或Java API中使用

我在iOS的API参考中找不到它


我需要的是根据时间戳(我更喜欢服务器而不是客户端时间戳)将数据推送到新的子位置,并在块中返回该引用。

是!我们将其重命名为更符合iOS命名约定,但其行为与ref.push()相同。如果您想设置数据(相当于ref.push(data)),可以执行
[[ref childByAutoId]setValue:data]

它在iOS上的行为似乎有所不同-在web API上,它给出一个数字作为键,但在iOS上,UUID如何将该值设置为true?例如:如果我写了:let requestId=historyRef.childByAutoId(),那么:driverRef.child(requestId).setValue(true),我会得到一个错误:“Bool”不能转换为“Any”—我如何解决这个问题。