Skip to main content

Issue Item

Issues item to a player's Inbox.

Call Information

// Issue item to one's own Inbox
public void SendItem (string tableCode, List<ItemValueModel> items, List<MessageValueModel> messages, int period, PlayNANOODelegate callback);

// Issue item or gift item to another player's Inbox.
public void SendItemPlayer (string tableCode, string playerId, List<ItemValueModel> items, List<MessageValueModel> messages, int period, PlayNANOODelegate callback);

Call Information Details

ParameterDescriptionType
tableCodeTable Codestring
playerIdPlayer unique IDstring
itemsIssue item informationList<PlayNANOO.Inbox.ItemValueModel>
messagesItem message information. When entering message information, default language (Configure.PN_LANG_CODE_DEFAULT) is required.List<PlayNANOO.Inbox.MessageValueModel>
periodItem holding period. Time unit for holding period is in days.integer
callbackCommunication resultPlayNANOODelegate

Source Code

using PlayNANOO;

public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;

void Awake()
{
plugin = Plugin.GetInstance();
}

// Issue item to one's own Inbox
public void ItemSend()
{
string tableCode = "TABLE_CODE";
int period = 365;

List<PlayNANOO.Inbox.ItemValueModel> items = new List<PlayNANOO.Inbox.ItemValueModel>();
List<PlayNANOO.Inbox.MessageValueModel> messages = new List<PlayNANOO.Inbox.MessageValueModel>();

items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_1", item_count = 10 });
items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_2", item_count = 20 });

// Default language Configure.PN_LANG_CODE_DEFAULT is required.
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_DEFAULT, title = "TEST", content = "TEST" });
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_KO, title = "TEST", content = "TEST" });

plugin.InboxManager.SendItem(tableCode, items, messages, period, (status, error, jsonString, values) =>
{
if(state.Equals(Configure.PN_API_STATE_SUCCESS)) {
Debug.Log("Success");
} else {
Debug.Log("Fail");
}
});
}

// Issue item or gift item to another player's Inbox
public void ItemSendPlayer()
{
string tableCode = "TABLE_CODE";
string playerId = "PLAYER_ID";
int period = 365;

List<PlayNANOO.Inbox.ItemValueModel> items = new List<PlayNANOO.Inbox.ItemValueModel>();
List<PlayNANOO.Inbox.MessageValueModel> messages = new List<PlayNANOO.Inbox.MessageValueModel>();

items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_1", item_count = 10 });
items.Add(new PlayNANOO.Inbox.ItemValueModel { item_code = "ITEM_CODE_2", item_count = 20 });

// 기본 언어 Configure.PN_LANG_CODE_DEFAULT 는 필수 입니다.
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_DEFAULT, title = "TEST", content = "TEST" });
messages.Add(new PlayNANOO.Inbox.MessageValueModel { language = Configure.PN_LANG_CODE_KO, title = "TEST", content = "TEST" });

plugin.InboxManager.SendItemPlayer(tableCode, playerId, items, messages, period, (status, error, jsonString, values) =>
{
if(state.Equals(Configure.PN_API_STATE_SUCCESS)) {
Debug.Log("Success");
} else {
Debug.Log("Fail");
}
});
}
}

Communication Result

HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"status": "success"
}

Communication Result

Data KeyDescriptionType
statusOperation resultstring