NIMSDK-iOS
载入中...
搜索中...
未找到
NIMUser.h
浏览该文件的文档.
1//
2// NIMUser.h
3// NIMLib
4//
5// Created by Netease.
6// Copyright (c) 2015 Netease. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10
11NS_ASSUME_NONNULL_BEGIN
12
13@class NIMUserInfo;
14
15/**
16 * 好友操作类型
17 */
18typedef NS_ENUM(NSInteger, NIMUserOperation){
19 /**
20 * 添加好友
21 * @discussion 直接添加为好友,无需验证
22 */
24 /**
25 * 请求添加好友
26 */
28 /**
29 * 通过添加好友请求
30 */
32 /**
33 * 拒绝添加好友请求
34 */
36};
37
38/**
39 * 用户性别
40 */
41typedef NS_ENUM(NSInteger, NIMUserGender) {
42 /**
43 * 未知性别
44 */
46 /**
47 * 性别男
48 */
50 /**
51 * 性别女
52 */
54};
55
56/**
57 * 云信用户
58 */
59@interface NIMUser : NSObject
60
61/**
62 * 用户Id
63 */
64@property (nullable,nonatomic,copy) NSString *userId;
65
66/**
67 * 备注名,长度限制为128个字符。
68 */
69@property (nullable,nonatomic,copy) NSString *alias;
70
71/**
72 * 扩展字段
73 */
74@property (nullable,nonatomic,copy) NSString *ext;
75
76/**
77 * 服务器扩展字段
78 * @discussion 该字段只能由服务器进行修改,客户端只能读取
79 *
80 */
81@property (nullable,nonatomic,copy,readonly) NSString *serverExt;
82
83/**
84 * 用户资料,仅当用户选择托管信息到云信时有效
85 * 用户资料除自己之外,不保证其他用户资料实时更新
86 * 其他用户资料更新的时机为: 1.调用 - (void)fetchUserInfos:completion: 方法刷新用户
87 * 2.收到此用户发来消息
88 * 3.程序再次启动,此时会同步好友信息
89 */
90@property (nullable,nonatomic,strong,readonly) NIMUserInfo *userInfo;
91
92/**
93 * 是否需要消息提醒
94 *
95 * @return 是否需要消息提醒
96 */
97- (BOOL)notifyForNewMsg;
98
99/**
100 * 是否在黑名单中
101 *
102 * @return 是否在黑名单中
103 */
104
105- (BOOL)isInMyBlackList;
106
107@end
108
109
110/**
111 * 用户资料,仅当用户选择托管信息到云信时有效
112 */
113@interface NIMUserInfo : NSObject
114
115/**
116 * 用户昵称
117 */
118@property (nullable,nonatomic,copy,readonly) NSString *nickName;
119
120/**
121 * 用户头像
122 */
123@property (nullable,nonatomic,copy,readonly) NSString *avatarUrl;
124
125/**
126 * 用户头像缩略图
127 * @discussion 仅适用于使用云信上传服务进行上传的资源,否则无效。
128 */
129@property (nullable,nonatomic,copy,readonly) NSString *thumbAvatarUrl;
130
131/**
132 * 用户签名
133 */
134@property (nullable,nonatomic,copy,readonly) NSString *sign;
135
136/**
137 * 用户性别
138 */
139@property (nonatomic,assign,readonly) NIMUserGender gender;
140
141/**
142 * 邮箱
143 */
144@property (nullable,nonatomic,copy,readonly) NSString *email;
145
146/**
147 * 生日
148 */
149@property (nullable,nonatomic,copy,readonly) NSString *birth;
150
151/**
152 * 电话号码
153 */
154@property (nullable,nonatomic,copy,readonly) NSString *mobile;
155
156/**
157 * 用户自定义扩展字段
158 */
159@property (nullable,nonatomic,copy,readonly) NSString *ext;
160
161
162@end
163
164/**
165 * 好友请求
166 */
167@interface NIMUserRequest : NSObject
168/**
169 * 目标用户ID
170 */
171@property (nonatomic,copy) NSString *userId;
172
173/**
174 * 操作类型
175 */
176@property (nonatomic,assign) NIMUserOperation operation;
177
178/**
179 * 附言
180 */
181@property (nullable,nonatomic,copy) NSString *message;
182
183@end
184
185NS_ASSUME_NONNULL_END
NIMUserOperation
Definition: NIMUser.h:18
@ NIMUserOperationRequest
Definition: NIMUser.h:27
@ NIMUserOperationAdd
Definition: NIMUser.h:23
@ NIMUserOperationVerify
Definition: NIMUser.h:31
@ NIMUserOperationReject
Definition: NIMUser.h:35
NIMUserGender
Definition: NIMUser.h:41
@ NIMUserGenderMale
Definition: NIMUser.h:49
@ NIMUserGenderUnknown
Definition: NIMUser.h:45
@ NIMUserGenderFemale
Definition: NIMUser.h:53
Definition: NIMUser.h:60
BOOL notifyForNewMsg()
NIMUserInfo * userInfo
Definition: NIMUser.h:90
NSString * alias
Definition: NIMUser.h:69
NSString * serverExt
Definition: NIMUser.h:81
NSString * userId
Definition: NIMUser.h:64
NSString * ext
Definition: NIMUser.h:74
BOOL isInMyBlackList()
Definition: NIMUser.h:114
Definition: NIMUser.h:168