好友搜索
查询已注册的好友信息。
调用信息
Friend(String friendCode, PlayNANOODelegate callback) {}
调用详细信息
| 参数 | 说明 | 类型 |
|---|---|---|
| friendCode | 好友表识别代码 | string |
| callback | 通信结果 | PlayNANOODelegate |
源代码
using PlayNANOO;
public class PlayNANOOExample : MonoBehaviour
{
Plugin plugin;
void Awake()
{
plugin = Plugin.GetInstance();
string friendCode = "string";
plugin.Friend(friendCode, (state, message, rawData, dictionary) => {
if(state.Equals(Configure.PN_API_STATE_SUCCESS)) {
foreach (Dictionary<string, object> value in (ArrayList)dictionary["friends"])
{
Debug.Log(value["relationship_code"]);
Debug.Log(value["uuid"]);
Debug.Log(value["nickname"]);
Debug.Log(value["access_timezone"]);
Debug.Log(value["access_diff"]);
Debug.Log(value["access_timestamp"]);
}
} else {
Debug.Log("Fail");
}
});
}
}
通信结果
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
"code" : 200,
"message" : 0,
"value" : [
{
"relationship_code" : "String"
"uuid" : "String",
"nickname" : "String",
"access_timezone" : "String",
"access_diff" : "Integer",
"access_timestamp" : "Integer"
}
]
}
通信结果详细信息
| 数据键 | 说明 | 类型 |
|---|---|---|
| relationship_code | 好友关系识别代码 | string |
| uuid | 玩家识别 ID | string |
| nickname | 玩家昵称 | string |
| access_timezone | 玩家登录时间时区 | string |
| access_diff | 玩家登录时间距当前时间已过的时长(秒) | Integer |
| access_timestamp | 玩家最后登录时间 Unix Timestamp | Integer |