Skip to main content
Version: SDK-5.9.6

GetReceivedRequestList

public BackendReturnObject GetReceivedRequestList();
public BackendReturnObject GetReceivedRequestList(int limit);
public BackendReturnObject GetReceivedRequestList(int limit, int offset);

Parameters

ValueTypeDescriptiondefault
limitint(Optional) Number of received friend request lists to load100
offsetint(Optional) Starting point of received friend request lists to load-

Description

Looks up received friend request lists.

Example

Synchronous

// Look up the entire received friend request list
Backend.Friend.GetReceivedRequestList();
// Look up the entire received friend request list using 'limit' and 'offset'
Backend.Friend.GetReceivedRequestList(5); // Look up the list of five people from which friend requests were received(1-5)
Backend.Friend.GetReceivedRequestList(5,5); // Look up the next five people after the first five from which friend requests were received(6-10)

Asynchronous

// Look up the entire received friend request list
Backend.Friend.GetReceivedRequestList((callback) => {
// Post-process
});
// Look up the entire received friend request list using 'limit' and 'offset'
Backend.Friend.GetReceivedRequestList(5, (callback) => {
// Look up the list of five people from which friend requests were received(1-5)
// Post-process
});
Backend.Friend.GetReceivedRequestList(5, 5, (callback) => {
// Look up the next five people after the first five from which friend requests were received(6-10)
// Post-process
});

SendQueue

// Look up the entire received friend request list
SendQueue.Enqueue(Backend.Friend.GetReceivedRequestList, (callback) => {
// Post-process
});
// Look up the entire received friend request list using 'limit' and 'offset'
SendQueue.Enqueue(Backend.Friend.GetReceivedRequestList, 5, (callback) => {
// Look up the list of five people from which friend requests were received(1-5)
// Post-process
});
SendQueue.Enqueue(Backend.Friend.GetReceivedRequestList, 5, 5, (callback) => {
// Look up the next five people after the first five from which friend requests were received(6-10)
// Post-process
});

Return cases

Success cases

When the lookup is successful
statusCode : 200
message : Success returnValue : refer to GetReturnValuetoJSON

GetReturnValuetoJSON

{ 
rows:
[
// When the user does not have a nickname
{
inDate: // Game user's inDate
{ S : "2018-12-27T04:49:00.493Z"},
createdAt: // Time friend request was sent
{ S : "2018-12-27T04:49:04.407Z"}
},
// When the user has a nickname
{
nickname: // Game user's nickname
{ S : "customid2"},
inDate: // Game user's inDate
{ S : "2018-12-18T01:58:18.722Z"},
createdAt: // Time friend request was sent
{ S : "2018-12-27T04:43:18.715Z"}
},
{
nickname: [Object],
inDate: [Object],
createdAt: [Object],
}
]
}

Sample code

public class FriendReqeustItem
{
public string nickname;
public string inDate;
public string createdAt;
public override string ToString()
{
return $"nickname : {nickname}\ninDate : {inDate}\ncreatedAt : {createdAt}\n";
}
};
public void GetReceivedRequestListTest()
{
var bro = Backend.Friend.GetReceivedRequestList();

if(!bro.IsSuccess())
return;

LitJson.JsonData json = bro.FlattenRows();
List<FriendReqeustItem> freindList = new List<FriendReqeustItem>();

for(int i = 0; i < json.Count; i++)
{
FriendReqeustItem friendItem = new FriendReqeustItem();

if(json[i].ContainsKey("nickname"))
{
friendItem.nickname = json[i]["nickname"].ToString();
}
friendItem.inDate = json[i]["inDate"].ToString();
friendItem.createdAt = json[i]["createdAt"].ToString();

freindList.Add(friendItem);
Debug.Log(friendItem.ToString());
}
}