0
我目前在iOS應用程序中觀察到Firebase數據庫中的數據。我想使用Firebase函數創建我自己的observe
函數,該函數在返回數據之前從單獨的數據庫中提取。用於Firebase雲端功能的自定義觀察器
有什麼方法可以重新創建我自己版本的Firebase API的觀察方法嗎?這是我目前爲止的內容
exports.onChildAdded = functions.https.onRequest((request, response) => {
var ref = firebase.database().ref("data");
ref.on("child_added", function(snapshot) {
console.log(snapshot.key);
var allData;
allData.firebase = snapshot;
//pull from other database
allData.other = otherDatabaseData;
response.send(allData);
});
})
這是不幸的,我想我只需要在設備端提出兩個請求。 –