TUIUserProfileDataProviderServiceProtocol Protocol Reference

Conforms to TCServiceProtocol
Declared in TUIUserProfileDataProviderServiceProtocol.h

Overview

本文件声明了用于获取用户信息的协议 实现了本协议的类,便可以根据传入的信息获取用户的姓名、签名、生日、添加方式、头像等用户信息。

– getName: required method

获取用户姓名。 如果当前信息对应的用户是好友的话,则通过 TIMFriendshipManager 提供的 queryFriend 接口获取好友,并进一步获取备注。 如果当前信息对应的用户不是好友,则返回传入信息中的用户 ID。

- (NSString *)getName:(TIMUserProfile *)profile

Return Value

返回的用户昵称。好友默认返回备注,当好友未设置备注或者为陌生人时返回用户 ID。

Declared In

TUIUserProfileDataProviderServiceProtocol.h

– getGender: required method

获取用户的性别。

- (NSString *)getGender:(TIMUserProfile *)profile

Parameters

profile

传入的用户资料。从该资料中获取特定的信息。

Return Value

以字符串形式返回用户性别。“男”/“女”/“未知”。

Declared In

TUIUserProfileDataProviderServiceProtocol.h

– getSignature: required method

获取用户签名。

- (NSString *)getSignature:(TIMUserProfile *)profile

Parameters

profile

传入的用户资料。从该资料中获取特定的信息。

Return Value

以字符串形式返回用户签名。

Declared In

TUIUserProfileDataProviderServiceProtocol.h

– getLocation: required method

获取用户所在地。

- (NSString *)getLocation:(TIMUserProfile *)profile

Parameters

profile

传入的用户资料。从该资料中获取特定的信息。

Return Value

以字符串形式返回用户所在地。

Declared In

TUIUserProfileDataProviderServiceProtocol.h

– getBirthday: required method

获取用户生日

- (NSDate *)getBirthday:(TIMUserProfile *)profile

Parameters

profile

传入的用户资料。从该资料中获取特定的信息。

Return Value

返回用户的生日。

Declared In

TUIUserProfileDataProviderServiceProtocol.h

– getAllowType: required method

获取用户的添加要求。用于在用户信息页面显示。

- (NSString *)getAllowType:(TIMUserProfile *)profile

Parameters

profile

传入的用户资料。从该资料中获取特定的信息。

Return Value

以字符串形式返回。 “同意任何用户加好友” / “需要验证” / “需要验证"。

Declared In

TUIUserProfileDataProviderServiceProtocol.h

– getAvatarView: required method

获取用户头像 profile 中含有用户头像的 URL,我们通过 URL 获取头像并包装为 UIImageView 后返回。

- (UIImageView *)getAvatarView:(TIMUserProfile *)profile

Parameters

profile

传入的用户资料。从该资料中获取特定的信息。

Return Value

将获取到的图像包装为 UIImageView 后返回。

Declared In

TUIUserProfileDataProviderServiceProtocol.h