Skip to main content
Version: SDK-5.11.6

GetSentRequestList

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

Parameters

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

Description

Looks up sent friend request lists. If the friend request is accepted/declined by the user, it will be deleted from the list.

Example

Synchronous

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

Asynchronous

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

SendQueue

SendQueue.Enqueue(Backend.Friend.GetSentRequestList, (callback) => 
{
// Post-process
});
// Look up the entire sent friend request list using 'limit' and 'offset'
SendQueue.Enqueue(Backend.Friend.GetSentRequestList, 5, (callback) =>
{
// Look up the list of five people to whom friend requests were sent(1-5)
// Post-process
});
SendQueue.Enqueue(Backend.Friend.GetSentRequestList, 5, 5, (callback) =>
{
// Look up the next five people after the first five to whom friend requests were sent(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 GetSentRequestListTest()
{
var bro = Backend.Friend.GetSentRequestList();

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());
}
}