Skip to main content

Random Search

Searches for recently connected players who are not friends.

Call Information

FriendRandomSearch(string friendCode, int searchLimit, PlayNANOODelegate callback) {}

Call Information Details

ParameterDescriptionType
friendCodeFriend table identification codestring
searchLimitQuery limit (Up to 10 people)integer
callbackCommunication resultPlayNANOODelegate

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

Communication Result

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"
},
]
}

Communication Result

Data KeyDescriptionType
uuidPlayer's unique IDstring
open_idPlayer's unique open IDstring
nicknamePlayer's nicknamestring
signin_timeTime elapsed in seconds since last loginstring
signin_datePlayer's last login timestring