Skip to main content
Version: 5.11.6

ReceivePostItemAll(User)

public BackendReturnObject ReceivePostItemAll(PostType postType);

Parameter

ValueTypeDescription
postTypePostTypeType of mail to claim all

PostType

ValueDescription
AdminAdmin mail sent from BACKND Console
RankRanking mail sent automatically after ranking settlement
UserUser mail sent using each user's data

Description

Claims all pieces of mail that have been looked up until now.

  • The data types "S", "L", and "M" in the return values of the previous mail function(Backend.Social.Post) was removed.
  • An error occurs if there is no mail to claim.

Example

Synchronous

var  bro = Backend.UPost.ReceivePostItemAll(PostType.User);

// For the logic to claim all mail, please refer to the 'Sample code.'

Asynchronous

Backend.UPost.ReceivePostItemAll(PostType.User, callback => {
// For the logic to claim all mail, please refer to the 'Sample code.'
});

SendQueue

SendQueue.Enqueue(Backend.UPost.ReceivePostItemAll, PostType.User, callback => {
// For the logic to claim all mail, please refer to the 'Sample code.'
});

Return cases

Success cases

When the lookup is successful
statusCode : 200

returnValue : refer to GetReturnValuetoJSON

Error cases

When there is no more mail to claim statusCode : 404
errorCode : NotFoundException

GetReturnValuetoJSON

User mail

{
"postItems": [
{
"key1": "Item1",
"key2": "Item2",
"key3": "Item3"
},
{
"key1": "Item4",
"key2": "Item5",
"key3": "Item6"
},
{
"key1": "Item7",
"key2": "Item8",
"key3": "Item9"
}
]
}

Inserted data

Param param = new Param();
Dictionary<string, string> dic = new Dictionary<string, string>();

dic.Add("key1", "Item1");
dic.Add("key2", "Item2");
dic.Add("key3", "Item3");

param.Add(columnName, dic);

string rowIndate = Backend.GameData.Insert(tableName, param).GetInDate();

PostItem postItem = new PostItem
{
Title = "Mail title",
Content = "Mail content",
TableName = tableName,
RowInDate = rowIndate,
Column = columnName
};
Backend.UPost.SendUserPost(userIndate, postItem);

Sample code

public void ReceivePostItemAllTest() {

BackendReturnObject bro = Backend.UPost.GetPostList(PostType.Coupon, 100);

if(bro.IsSuccess() == false) {
Debug.Log("An error occurred while loading the mail.");
return;
}

var receiveBro = Backend.UPost.ReceivePostItemAll(PostType.Coupon);

if(receiveBro.IsSuccess() == false) {
Debug.LogError("An error occurred while claiming all mail. : " + receiveBro);
return;
}

System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();

foreach(LitJson.JsonData postItemJson in receiveBro.GetReturnValuetoJSON()["postItems"]) {
foreach(string postItemKey in postItemJson.Keys) {
stringBuilder.AppendLine($"{postItemKey} : {postItemJson[postItemKey].ToString()}");
}
stringBuilder.AppendLine();
}

Debug.Log(stringBuilder.ToString());
}