Skip to main content
Version: 5.9.6

GetProductList

public BackendReturnObject GetProductList();

Description

You can look up the list of game cash items registered in BACKND Console.

Example

Synchronous

Backend.TBC.GetProductList();

Asynchronous

Backend.TBC.GetProductList((callback) => 
{
// Post-process
});

SendQueue

SendQueue.Enqueue(Backend.TBC.GetProductList, callback => {
// Post-process
});

Return cases

Success cases

When the lookup is successful
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

Error cases

When there is no product registered in BACKND Console
statusCode : 404
errorCode : NotFoundException

GetReturnValuetoJSON

{
rows:
[
{
TBC: { N : 3300 }, // TBC value
inDate: { S : "2018-03-06T02:26:09.526Z"}, // Cash item indate
uuid: { S : "bb35b960-20e5-11e8-8fdb-4928c1afeae2" }, // Cash item uuid
name: { S : "Luden's Echo" }, // Name of cash item
explain: { S : "Rare item" } // Cash item description
},
{
TBC: [Object],
inDate: [Object],
uuid: [Object],
name: [Object],
explain: [Object]
}
}

Sample code

public class ProductItem
{
public string TBC;
public string inDate;
public string uuid;
public string name;
public string explain;
public override string ToString()
{
return $"TBC : {TBC}\ninDate : {inDate}\nuuid : {uuid}\nname : {name}\nexplain : {explain}\n";
}
};
public void GetProductList()
{
var bro = Backend.TBC.GetProductList();

LitJson.JsonData json = bro.FlattenRows();
List<ProductItem> productList = new List<ProductItem>();

for(int i = 0; i < json.Count; i++)
{
ProductItem product = new ProductItem();

product.TBC = json[i]["TBC"].ToString();
product.inDate = json[i]["inDate"].ToString();
product.uuid = json[i]["uuid"].ToString();
product.name = json[i]["name"].ToString();
product.explain = json[i]["explain"].ToString();

productList.Add(product);
Debug.Log(product.ToString());
}
}