2015-07-22 98 views
0
var reference = Firebase(url: "https://myapp.firebaseio.com/the_awesome_node") 
    reference.observeEventType(FEventType.Value, withBlock: { (snapshot) -> Void in 
     //do something 
    }) 

後來在我的代碼中,我想得到https://myapp.firebaseio.com/the_awesome_node給出的參考(Firebase類)。如何獲取iOS中的Firebase網址?

我在API中找不到它。

回答

1

解決:

reference.parent + "/" + reference.key 
+0

備選地'reference.parent.childByAppendingPath(reference.key)'。請參閱https://www.firebase.com/docs/ios/guide/saving-data.html#section-setvalue –