Rest api Firebase 统一

问题描述 投票:0回答:0

我想获取特定用户Id下的所有数据(数据列表)

我的脚本只显示在特定用户 ID 下添加到数据库的最后数据,而不是全部。

public void GetFromDatabase()
{
    // Get user ID from input field
    userId = user.UserId;

    // Get game ID
    gameId = GameIdText.text;

    //URL 
    string url = "https://cod-02-2023-default-rtdb.europe-west1.firebasedatabase.app/" + userId + ".json";
    Debug.Log(url);

    // Use the RestClient to get the wave data from the database
    RestClient.Get<User>(url).Then(response =>
    {
        // Get the game data for the specified game ID
        userObj = response;

        // Update the UI with user data
        UpdateScore();
    });

}
firebase api rest unityscript
© www.soinside.com 2019 - 2024. All rights reserved.