Random Search
Searches for recently connected players who are not friends with you.
Call Information
FriendRandomSearch(string friendCode, int searchLimit, PlayNANOODelegate callback) {}
Call Details
| Parameter | Description | Type |
|---|---|---|
| friendCode | Friend table identification code | string |
| searchLimit | Search limit (max 10) | integer |
| callback | Communication result | PlayNANOODelegate |
Source Code
using PlayNANOO;
public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;
void Awake()
{
plugin = Plugin.GetInstance();
string friendCode = "string";
int searchLimit = 10;
plugin.FriendRandomSearch(friendCode, searchLimit, (state, message, rawData, dictionary) => {
if(state.Equals(Configure.PN_API_STATE_SUCCESS)) {
foreach (Dictionary<string, object> value in (ArrayList)dictionary["friends"])
{
Debug.Log(value["uuid"]);
Debug.Log(value["open_id"]);
Debug.Log(value["nickname"]);
Debug.Log(value["signin_time"]);
Debug.Log(value["signin_date"]);
}
} else {
Debug.Log("Fail");
}
});
}
}
Response
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"code" : 200,
"message" : 0,
"value" : [
{
"uuid": "String",
"open_id": "String",
"nickname": "String",
"signin_time": "Integer",
"signin_date": "String"
},
]
}
Response Details
| Data Key | Description | Type |
|---|---|---|
| uuid | Player identification ID | string |
| open_id | Player identification open ID | string |
| nickname | Player nickname | string |
| signin_time | Time elapsed since last login based on current time (in seconds) | string |
| signin_date | Player last login time | string |