GetSentFriendRequestList
public BackndFriendRequestReturnObject GetSentFriendRequestList();
public BackndFriendRequestReturnObject GetSentFriendRequestList(int limit);
public BackndFriendRequestReturnObject GetSentFriendRequestList(int limit, int offset);
BackndFriendRequestReturnObject
GetReturnValueByFriendRequestList
If an error occurred, null is returned.
BackndFriendRequestReturnObject bro = Backnd.Friend.GetSentFriendRequestList();
foreach(BackndFriendRequestItem item in bro.GetReturnValueByFriendRequestList()) {
Debug.Log(item.ToString());
}
BackndFriendRequestItem
public class BackndFriendRequestItem
{
public string nickname;
public string inDate;
public string createdAt;
}
Parameters
Value | Type | Description | default |
---|---|---|---|
limit | int | (Optional) Number of sent friend request lists to load | 100 |
offset | int | (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
Backnd.Friend.GetSentFriendRequestList();
// Look up the entire sent friend request list using 'limit' and 'offset'
Backnd.Friend.GetSentFriendRequestList(5); // Look up the list of five people to whom friend requests were sent(1-5)
Backnd.Friend.GetSentFriendRequestList(5, 5); // Look up the next five people after the first five to whom friend requests were sent(6-10)
Asynchronous
Backnd.Friend.GetSentFriendRequestList((callback) =>
{
// Post-process
});
// Look up the entire sent friend request list using 'limit' and 'offset'
Backnd.Friend.GetSentFriendRequestList(5, (callback) =>
{
// Look up the list of five people to whom friend requests were sent(1-5)
// Post-process
});
Backnd.Friend.GetSentFriendRequestList(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
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 GetSentFriendRequestListTest()
{
var bro = Backnd.Friend.GetSentFriendRequestList();
if(!bro.IsSuccess())
return;
BACKND.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());
}
}