Query Item
Queries information about items stored in the player's Inbox.
Call Information
public void Items (string tableCode, PlayNANOODelegate callback);
Call Information Details
Parameter | Description | Type |
---|---|---|
tableCode | Table Code | string |
callback | Communication result | PlayNANOODelegate |
Source Code
using PlayNANOO;
public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;
void Awake()
{
plugin = Plugin.GetInstance();
string tableCode = "TABLE_CODE";
plugin.InboxManager.Items(tableCode, (status, error, jsonString, values) =>
{
if (status.Equals(Configure.PN_API_STATE_SUCCESS))
{
foreach (Dictionary<string, object> value in (ArrayList)values["Items"])
{
Debug.Log(value["Type"]);
Debug.Log(value["ItemKey"]);
Debug.Log(value["ExpireSec"]);
PlayNANOO.Inbox.ItemValueModel[] items = value["Items"] as PlayNANOO.Inbox.ItemValueModel[];
foreach (PlayNANOO.Inbox.ItemValueModel item in items)
{
Debug.Log(item.item_code);
Debug.Log(item.item_count);
}
PlayNANOO.Inbox.MessageValueModel[] messages = value["Messages"] as PlayNANOO.Inbox.MessageValueModel[];
foreach (PlayNANOO.Inbox.MessageValueModel message in messages)
{
Debug.Log(message.language);
Debug.Log(message.title);
Debug.Log(message.content);
}
}
}
else
{
Debug.Log("Fail");
}
});
}
}
Communication Result
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"items": [
{
"type": "item",
"item_key": "itemKey",
"items": [
{
"item_code": "gold",
"item_count": 100
}
],
"messages": [
{
"language": "default",
"title": "hello",
"content": "hello world"
}
],
"expire_sec": 3600
}
]
}
Communication Result Details
Data Key | Description | Type |
---|---|---|
type | Item issue type event : Event issue item item : Standard item | string |
item_key | Item identification key | string |
items.item_code | Item code | string |
items.item_count | Item quantity | integer |
messages.language | Message language code | string |
messages.title | Message title | string |
messages.content | Message content | string |
expire_sec | Item expiration time Time is in seconds | integer |