tencent cloud

文档反馈

关系链相关接口

最后更新时间:2023-03-10 14:36:38

    关系链介绍请参考 关系链系统简介

    TIMFriendshipGetFriendProfileList

    获取好友列表。

    原型

    TIM_DECL int TIMFriendshipGetFriendProfileList(TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    cb TIMCommCallback 获取好友列表成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult
    说明:

    此接口通过回调返回所有好友资料 FriendProfile

    TIMFriendshipAddFriend

    添加好友。

    原型

    TIM_DECL int TIMFriendshipAddFriend(const char* json_add_friend_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_add_friend_param const char* 添加好友接口参数的 JSON 字符串
    cb TIMCommCallback 添加好友成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult
    说明:

    好友关系有单向和双向好友之分。详情请参考 添加好友

    示例

    Json::Value json_add_friend_param;
    json_add_friend_param[kTIMFriendshipAddFriendParamIdentifier] = "user4";
    json_add_friend_param[kTIMFriendshipAddFriendParamFriendType] = FriendTypeBoth;
    json_add_friend_param[kTIMFriendshipAddFriendParamAddSource] = "Windows";
    json_add_friend_param[kTIMFriendshipAddFriendParamAddWording] = "I am Iron Man";
    int ret = TIMFriendshipAddFriend(json_add_friend_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
        if (ERR_SUCC != code) {
            // 添加好友失败
            return;
        }
    }, nullptr);
    

    TIMFriendshipHandleFriendAddRequest

    处理好友请求。

    原型

    TIM_DECL int TIMFriendshipHandleFriendAddRequest(const char* json_handle_friend_add_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_handle_friend_add_param const char* 处理好友请求接口参数的 JSON 字符串
    cb TIMCommCallback 处理好友请求成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult
    说明:

    当自己的个人资料的加好友权限kTIMUserProfileAddPermission设置为kTIMProfileAddPermission_NeedConfirm时,别人添加自己为好友时会收到一个加好友的请求,可通过此接口处理加好友的请求。

    示例

    Json::Value json_handle_friend_add_param;
    json_handle_friend_add_param[kTIMFriendResponeIdentifier] = "user1";
    json_handle_friend_add_param[kTIMFriendResponeAction] = ResponseActionAgreeAndAdd;
    json_handle_friend_add_param[kTIMFriendResponeRemark] = "I am Captain China";
    json_handle_friend_add_param[kTIMFriendResponeGroupName] = "schoolmate";
    int ret = TIMFriendshipHandleFriendAddRequest(json_handle_friend_add_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
    
    }, nullptr);
    

    TIMFriendshipModifyFriendProfile

    更新好友资料(备注等)。

    原型

    TIM_DECL int TIMFriendshipModifyFriendProfile(const char* json_modify_friend_info_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_modify_friend_info_param const char* 更新好友资料接口参数的 JSON 字符串
    cb TIMCommCallback 更新好友资料成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    示例

    Json::Value json_modify_friend_profile_item;
    json_modify_friend_profile_item[kTIMFriendProfileItemRemark] = "xxxx yyyy";  // 修改备注
    json_modify_friend_profile_item[kTIMFriendProfileItemGroupNameArray].append("group1"); // 修改好友所在分组
    json_modify_friend_profile_item[kTIMFriendProfileItemGroupNameArray].append("group2");
    
    Json::Value json_modify_friend_profilie_custom;
    json_modify_friend_profilie_custom[kTIMFriendProfileCustemStringInfoKey] = "Str";
    json_modify_friend_profilie_custom[kTIMFriendProfileCustemStringInfoValue] = "this is changed value";
    json_modify_friend_profile_item[kTIMFriendProfileItemCustomStringArray].append(json_modify_friend_profilie_custom); // 修改好友资料自定义字段 " Str " 的值
    

    TIMFriendshipDeleteFriend

    删除好友。

    原型

    TIM_DECL int TIMFriendshipDeleteFriend(const char* json_delete_friend_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_delete_friend_param const char* 删除好友接口参数的 JSON 字符串
    cb TIMCommCallback 删除好友成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult
    说明:

    删除好友也有删除单向好友还是双向好友之分,删除好友

    示例

    Json::Value json_delete_friend_param;
    json_delete_friend_param[kTIMFriendshipDeleteFriendParamIdentifierArray].append("user4");
    json_delete_friend_param[kTIMFriendshipDeleteFriendParamFriendType] = FriendTypeSignle;
    int ret = TIMFriendshipDeleteFriend(json_delete_friend_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
        if (ERR_SUCC != code) {
            // 删除好友失败
            return;
        }
    }, nullptr);
    

    TIMFriendshipCheckFriendType

    检测好友类型(单向或双向)。

    原型

    TIM_DECL int TIMFriendshipCheckFriendType(const char* json_check_friend_list_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_check_friend_list_param const char* 检测好友接口参数的 JSON 字符串
    cb TIMCommCallback 检测好友成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult
    说明:

    开发者可以通过此接口检测给定的UserID列表跟当前账户的好友关系,检测好友相关内容请参考 检测好友

    示例

    Json::Value json_check_friend_list_param;
    json_check_friend_list_param[kTIMFriendshipCheckFriendTypeParamCheckType] = FriendTypeBoth;
    json_check_friend_list_param[kTIMFriendshipCheckFriendTypeParamIdentifierArray].append("user4");
    int ret = TIMFriendshipCheckFriendType(json_check_friend_list_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
    
    }, nullptr);
    

    TIMFriendshipCreateFriendGroup

    创建好友分组。

    原型

    TIM_DECL int TIMFriendshipCreateFriendGroup(const char* json_create_friend_group_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_create_friend_group_param const char* 创建好友分组接口参数的 JSON 字符串
    cb TIMCommCallback 创建好友分组成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult
    说明:

    不能创建已存在的分组。

    示例

    Json::Value json_create_friend_group_param;
    json_create_friend_group_param[kTIMFriendshipCreateFriendGroupParamNameArray].append("Group123");
    json_create_friend_group_param[kTIMFriendshipCreateFriendGroupParamIdentifierArray].append("user4");
    json_create_friend_group_param[kTIMFriendshipCreateFriendGroupParamIdentifierArray].append("user10");
    int ret = TIMFriendshipCreateFriendGroup(json_create_friend_group_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
        
    }, nullptr);
    

    TIMFriendshipGetFriendGroupList

    获取指定好友分组的分组信息。

    原型

    TIM_DECL int TIMFriendshipGetFriendGroupList(const char* json_get_friend_group_list_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_get_friend_group_list_param const char* 获取好友分组信息接口参数的 JSON 字符串
    cb TIMCommCallback 获取好友分组信息成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    示例

    Json::Value json_get_friend_group_list_param;
    json_get_friend_group_list_param.append("Group123");
    int ret = TIMFriendshipGetFriendGroupList(json_get_friend_group_list_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
        
    }, nullptr);
    

    TIMFriendshipModifyFriendGroup

    修改好友分组。

    原型

    TIM_DECL int TIMFriendshipModifyFriendGroup(const char* json_modify_friend_group_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_modify_friend_group_param const char* 修改好友分组接口参数的 JSON 字符串
    cb TIMCommCallback 修改好友分组成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    示例

    Json::Value json_modify_friend_group_param;
    json_modify_friend_group_param[kTIMFriendshipModifyFriendGroupParamName] = "Group123";
    json_modify_friend_group_param[kTIMFriendshipModifyFriendGroupParamNewName] = "GroupNewName";
    json_modify_friend_group_param[kTIMFriendshipModifyFriendGroupParamDeleteIdentifierArray].append("user4");
    json_modify_friend_group_param[kTIMFriendshipModifyFriendGroupParamAddIdentifierArray].append("user9");
    json_modify_friend_group_param[kTIMFriendshipModifyFriendGroupParamAddIdentifierArray].append("user5");
    int ret = TIMFriendshipModifyFriendGroup(json_modify_friend_group_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
        
    }, nullptr);
    

    TIMFriendshipDeleteFriendGroup

    删除好友分组。

    原型

    TIM_DECL int TIMFriendshipDeleteFriendGroup(const char* json_delete_friend_group_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_delete_friend_group_param const char* 删除好友分组接口参数的 JSON 字符串
    cb TIMCommCallback 删除好友分组成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    示例

    Json::Value json_delete_friend_group_param;
    json_delete_friend_group_param.append("GroupNewName");
    int ret = TIMFriendshipDeleteFriendGroup(json_delete_friend_group_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
        
    }, nullptr);
    

    TIMFriendshipAddToBlackList

    添加指定用户到黑名单。

    原型

    TIM_DECL int TIMFriendshipAddToBlackList(const char* json_add_to_blacklist_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_add_to_blacklist_param const char* 添加指定用户到黑名单接口参数的 JSON 字符串
    cb TIMCommCallback 添加指定用户到黑名单成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    示例

    Json::Value json_add_to_blacklist_param;
    json_add_to_blacklist_param.append("user5");
    json_add_to_blacklist_param.append("user10");
    int ret = TIMFriendshipAddToBlackList(json_add_to_blacklist_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
        
    }, nullptr);
    

    TIMFriendshipGetBlackList

    获取黑名单列表。

    原型

    TIM_DECL int TIMFriendshipGetBlackList(TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    cb TIMCommCallback 获取黑名单列表成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    TIMFriendshipDeleteFromBlackList

    从黑名单中删除指定用户列表。

    原型

    TIM_DECL int TIMFriendshipDeleteFromBlackList(const char* json_delete_from_blacklist_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_delete_from_blacklist_param const char* 从黑名单中删除指定用户接口参数的 JSON 字符串
    cb TIMCommCallback 从黑名单中删除指定用户成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    示例

    Json::Value json_delete_from_blacklist_param;
    json_delete_from_blacklist_param.append("user5");
    json_delete_from_blacklist_param.append("user10");
    int ret = TIMFriendshipDeleteFromBlackList(json_delete_from_blacklist_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
        
    }, nullptr);
    

    TIMFriendshipGetPendencyList

    获取好友添加请求未决信息列表。

    原型

    TIM_DECL int TIMFriendshipGetPendencyList(const char* json_get_pendency_list_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_get_pendency_list_param const char* 获取未决列表接口参数的 JSON 字符串
    cb TIMCommCallback 获取未决列表成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult
    说明:

    好友添加请求未决信息是指好友添加请求未处理的操作。例如,开发者添加对方为好友,对方还没有处理;或者有人添加开发者为好友,开发者还没有处理,称之为好友添加请求未决信息。

    示例

    Json::Value json_get_pendency_list_param;
    json_get_pendency_list_param[kTIMFriendshipGetPendencyListParamType] = FriendPendencyTypeBoth;
    json_get_pendency_list_param[kTIMFriendshipGetPendencyListParamStartSeq] = 0;
    int ret = TIMFriendshipGetPendencyList(json_get_pendency_list_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
        
    }, nullptr);
    

    TIMFriendshipDeletePendency

    删除指定好友添加请求未决信息。

    原型

    TIM_DECL int TIMFriendshipDeletePendency(const char* json_delete_pendency_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_delete_pendency_param const char* 删除指定未决信息接口参数的 JSON 字符串
    cb TIMCommCallback 删除指定未决信息成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    示例

    Json::Value json_delete_pendency_param;
    json_delete_pendency_param[kTIMFriendshipDeletePendencyParamType] = FriendPendencyTypeComeIn;
    json_delete_pendency_param[kTIMFriendshipDeletePendencyParamIdentifierArray].append("user1");
    int ret = TIMFriendshipDeletePendency(json_delete_pendency_param.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_params, const void* user_data) {
        
    }, nullptr);
    

    TIMFriendshipReportPendencyReaded

    上报好友添加请求未决信息已读。

    原型

    TIM_DECL int TIMFriendshipReportPendencyReaded(uint64_t time_stamp, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    time_stamp uint64_t 上报未决信息已读时间戳
    cb TIMCommCallback 上报未决信息已读用户成功与否的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    示例

    TIMFriendshipReportPendencyReaded(0, [](int32_t code, const char* desc, const char* json_param, const void* user_data) {
    
    }, nullptr);
    
    // json_param 为空字符串,判断 code 确认结果即可
    

    TIMFriendshipSearchFriends

    搜索好友(5.4.666 及以上版本支持,需要您购买旗舰版套餐)。

    原型

    TIM_DECL int TIMFriendshipSearchFriends(const char *json_search_friends_param, TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_search_friends_param const char* 搜索好友的关键字和域,请参考 FriendSearchParam
    cb TIMCommCallback 搜索好友的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    示例

    Json::Object json_obj;
    
    Json::Array json_keyword_list;
    json_keyword_list.push_back("98826");
    json_obj[kTIMFriendshipSearchParamKeywordList] = json_keyword_list;
    
    Json::Array json_search_field_list;
    json_search_field_list.push_back(kTIMFriendshipSearchFieldKey_Identifier);
    json_obj[kTIMFriendshipSearchParamSearchFieldList] = json_search_field_list;
    TIMFriendshipSearchFriends(json_obj.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_param, const void* user_data) {
    
    }, nullptr);
    
    json_obj.toStyledString().c_str() 得到 JSON 字符串如下:
    {
        "friendship_search_param_keyword_list": ["98826"],
        "friendship_search_param_search_field_list": [1]
    }
    
    // 回调的 json_param 示例。 json key 请参考 [FriendProfile](TIMCloudDef.h)
    [{
    "friend_profile_add_source": "AddSource_Type_contact",
    "friend_profile_add_time": 1620786162,
    "friend_profile_add_wording": "work together",
    "friend_profile_custom_string_array": [{
        "friend_profile_custom_string_info_key": "Tag_Profile_Custom_Str",
        "friend_profile_custom_string_info_value": "test3-lamar-value"
    }],
    "friend_profile_group_name_array": ["friend1"],
    "friend_profile_identifier": "98826",
    "friend_profile_remark": "shoujihao",
    "friend_profile_user_profile": {
        "user_profile_add_permission": 1,
        "user_profile_birthday": 2000,
        "user_profile_custom_string_array": [{
            "user_profile_custom_string_info_key": "Tag_Profile_Custom_Str",
            "user_profile_custom_string_info_value": "test3-lamar-value"
        }],
        "user_profile_face_url": "test1-www.google.com",
        "user_profile_gender": 2,
        "user_profile_identifier": "98826",
        "user_profile_language": 1000,
        "user_profile_level": 3000,
        "user_profile_location": "深圳",
        "user_profile_nick_name": "test change8888",
        "user_profile_role": 4000,
        "user_profile_self_signature": "1111111"
    }
    }]
    

    TIMFriendshipGetFriendsInfo

    获取好友信息。

    原型

    TIM_DECL int TIMFriendshipGetFriendsInfo(const char *json_get_friends_info_param,  TIMCommCallback cb, const void* user_data);
    

    参数

    参数 类型 含义
    json_get_friends_info_param const char* 获取好友的 userid 列表
    cb TIMCommCallback 获取好友信息的回调。回调函数定义请参考 TIMCommCallback
    user_data const void* 用户自定义数据,IM SDK 只负责传回给回调函数 cb,不做任何处理

    返回值

    类型 含义
    int 返回 TIM_SUCC 表示接口调用成功(接口只有返回 TIM_SUCC,回调 cb 才会被调用),其他值表示接口调用失败。每个返回值的定义请参考 TIMResult

    示例

    Json::Array json_array;
    json_array.append("98826");
    TIMFriendshipGetFriendsInfo(json_array.toStyledString().c_str(), [](int32_t code, const char* desc, const char* json_param, const void* user_data) {
        printf("GetFriendsInfo code:%d|desc:%s|json_param %s\r\n", code, desc, json_param);
    }, nullptr);
    
    json_array.toStyledString().c_str() 得到 JSON 字符串如下:
    ["98826"]
    
    // 回调的 json_param 示例。 json key 请参考 [FriendInfoGetResult](TIMCloudDef.h)
    
    [{
    "friendship_friend_info_get_result_error_code": 0,
    "friendship_friend_info_get_result_error_message": "OK",
    "friendship_friend_info_get_result_field_info": {
        "friend_profile_add_source": "AddSource_Type_contact",
        "friend_profile_add_time": 1620786162,
        "friend_profile_add_wording": "work together",
        "friend_profile_custom_string_array": [{
            "friend_profile_custom_string_info_key": "Tag_Profile_Custom_Str",
            "friend_profile_custom_string_info_value": "test3-lamar-value"
        }],
        "friend_profile_group_name_array": ["friend1"],
        "friend_profile_identifier": "98826",
        "friend_profile_remark": "shoujihao",
        "friend_profile_user_profile": {
            "user_profile_add_permission": 1,
            "user_profile_birthday": 2000,
            "user_profile_custom_string_array": [{
                "user_profile_custom_string_info_key": "Tag_Profile_Custom_Str",
                "user_profile_custom_string_info_value": "test3-lamar-value"
            }],
            "user_profile_face_url": "test1-www.google.com",
            "user_profile_gender": 2,
            "user_profile_identifier": "98826",
            "user_profile_language": 1000,
            "user_profile_level": 3000,
            "user_profile_location": "shenzhen",
            "user_profile_nick_name": "test change8888",
            "user_profile_role": 4000,
            "user_profile_self_signature": "1111111"
        }
    },
    "friendship_friend_info_get_result_relation_type": 3,
    "friendship_friend_info_get_result_userid": "98826"
    ]
    
    联系我们

    联系我们,为您的业务提供专属服务。

    技术支持

    如果你想寻求进一步的帮助,通过工单与我们进行联络。我们提供7x24的工单服务。

    7x24 电话支持