Skip to content

Commit 48163c0

Browse files
Merge pull request #139 from jpush/dev
Dev
2 parents 0b67e81 + fd977b4 commit 48163c0

File tree

14 files changed

+483
-62
lines changed

14 files changed

+483
-62
lines changed

ios/RCTJMessageModule.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
6212EB1A1F3C34BB00BDF51A /* RCTJMessageModule.m in Sources */ = {isa = PBXBuildFile; fileRef = 6212EB191F3C34BB00BDF51A /* RCTJMessageModule.m */; };
1111
6212EB1B1F3C34BB00BDF51A /* RCTJMessageModule.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 6212EB181F3C34BB00BDF51A /* RCTJMessageModule.h */; };
12-
628AD37220CE4CEE00EF14ED /* JMessage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 628AD37120CE4CEE00EF14ED /* JMessage.framework */; };
12+
629543F021E86C10000314E4 /* JMessage.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 629543EF21E86C10000314E4 /* JMessage.framework */; };
1313
62D683E21F4469820083CDF6 /* JMessageHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 62D683E11F4469820083CDF6 /* JMessageHelper.m */; };
1414
/* End PBXBuildFile section */
1515

@@ -30,7 +30,7 @@
3030
6212EB151F3C34BB00BDF51A /* libRCTJMessageModule.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libRCTJMessageModule.a; sourceTree = BUILT_PRODUCTS_DIR; };
3131
6212EB181F3C34BB00BDF51A /* RCTJMessageModule.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RCTJMessageModule.h; sourceTree = "<group>"; };
3232
6212EB191F3C34BB00BDF51A /* RCTJMessageModule.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = RCTJMessageModule.m; sourceTree = "<group>"; };
33-
628AD37120CE4CEE00EF14ED /* JMessage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JMessage.framework; sourceTree = "<group>"; };
33+
629543EF21E86C10000314E4 /* JMessage.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JMessage.framework; sourceTree = "<group>"; };
3434
62D683E01F4469820083CDF6 /* JMessageHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JMessageHelper.h; sourceTree = "<group>"; };
3535
62D683E11F4469820083CDF6 /* JMessageHelper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JMessageHelper.m; sourceTree = "<group>"; };
3636
/* End PBXFileReference section */
@@ -40,7 +40,7 @@
4040
isa = PBXFrameworksBuildPhase;
4141
buildActionMask = 2147483647;
4242
files = (
43-
628AD37220CE4CEE00EF14ED /* JMessage.framework in Frameworks */,
43+
629543F021E86C10000314E4 /* JMessage.framework in Frameworks */,
4444
);
4545
runOnlyForDeploymentPostprocessing = 0;
4646
};
@@ -66,7 +66,7 @@
6666
6212EB171F3C34BB00BDF51A /* RCTJMessageModule */ = {
6767
isa = PBXGroup;
6868
children = (
69-
628AD37120CE4CEE00EF14ED /* JMessage.framework */,
69+
629543EF21E86C10000314E4 /* JMessage.framework */,
7070
62D683E01F4469820083CDF6 /* JMessageHelper.h */,
7171
62D683E11F4469820083CDF6 /* JMessageHelper.m */,
7272
6212EB181F3C34BB00BDF51A /* RCTJMessageModule.h */,

ios/RCTJMessageModule/JMessage.framework/Headers/JMSGChatRoom.h

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,79 @@ JMSG_ASSUME_NONNULL_BEGIN
135135
*/
136136
- (void)getChatRoomOwnerInfo:(JMSGCompletionHandler JMSG_NULLABLE)handler;
137137

138+
/*!
139+
* @abstract 聊天室的黑名单列表
140+
*
141+
* @param handler 结果回调. resultObject 是 NSArray 类型,元素是 JMSGUser
142+
*
143+
* @since 3.8.0
144+
*/
145+
- (void)chatRoomBlacklist:(JMSGCompletionHandler JMSG_NULLABLE)handler;
146+
147+
/*!
148+
* @abstract 添加黑名单
149+
*
150+
* @param usernames 用户名列表
151+
* @param appkey 用户 appKey,usernames 中的所有用户必须在同一个 AppKey 下,不填则默认为本应用 appKey
152+
* @param handler 结果回调。error 为 nil 表示成功.
153+
*
154+
* @since 3.8.0
155+
*/
156+
- (void)addBlacklistWithUsernames:(NSArray <__kindof NSString *>*)usernames
157+
appKey:(NSString *JMSG_NULLABLE)appKey
158+
handler:(JMSGCompletionHandler JMSG_NULLABLE)handler;
159+
/*!
160+
* @abstract 删除黑名单
161+
*
162+
* @param usernames 用户名列表
163+
* @param appkey 用户 appKey,usernames 中的所有用户必须在同一个 AppKey 下,不填则默认为本应用 appKey
164+
* @param handler 结果回调。error 为 nil 表示成功.
165+
*
166+
* @since 3.8.0
167+
*/
168+
- (void)deleteBlacklistWithUsernames:(NSArray <__kindof NSString *>*)usernames
169+
appKey:(NSString *JMSG_NULLABLE)appKey
170+
handler:(JMSGCompletionHandler JMSG_NULLABLE)handler;
171+
172+
/*!
173+
* @abstract 管理员列表
174+
*
175+
* @param handler 结果回调. resultObject 是 NSArray 类型,元素是 JMSGUser
176+
*
177+
* @discussion 注意:返回列表中不包含房主.
178+
*
179+
* @since 3.8.0
180+
*/
181+
- (void)chatRoomAdminList:(JMSGCompletionHandler JMSG_NULLABLE)handler;
182+
183+
/*!
184+
* @abstract 添加管理员
185+
*
186+
* @param usernames 用户名列表
187+
* @param appkey 用户 AppKey,不填则默认为本应用 AppKey
188+
* @param handler 结果回调。error 为 nil 表示成功.
189+
*
190+
* @discussion 注意:非 VIP 应用最多设置 15 个管理员,不包括群主本身
191+
*
192+
* @since 3.8.0
193+
*/
194+
- (void)addAdminWithUsernames:(NSArray <__kindof NSString *>*)usernames
195+
appKey:(NSString *JMSG_NULLABLE)appkey
196+
handler:(JMSGCompletionHandler JMSG_NULLABLE)handler;
197+
198+
/*!
199+
* @abstract 删除管理员
200+
*
201+
* @param usernames 用户名列表
202+
* @param appkey 用户 AppKey,不填则默认为本应用 AppKey
203+
* @param handler 结果回调。error 为 nil 表示成功.
204+
*
205+
* @since 3.8.0
206+
*/
207+
- (void)deleteAdminWithUsernames:(NSArray <__kindof NSString *>*)usernames
208+
appKey:(NSString *JMSG_NULLABLE)appkey
209+
handler:(JMSGCompletionHandler JMSG_NULLABLE)handler;
210+
138211
/*!
139212
* @abstract 聊天室的展示名
140213
*

ios/RCTJMessageModule/JMessage.framework/Headers/JMSGConstants.h

Lines changed: 90 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ typedef NS_ENUM(NSInteger,JMSGTransMessageType) {
237237
};
238238

239239
/*!
240-
* 通知事件类型
240+
* 消息事件类型
241241
*
242242
* 本类 JMSGEventNotificationType 是 SDK 下发的通知事件类型,主要分为:消息事件、非消息事件
243243
*
@@ -247,30 +247,9 @@ typedef NS_ENUM(NSInteger,JMSGTransMessageType) {
247247
*
248248
* #### 非消息事件
249249
*
250-
* 如:被踢、登录状态异常、加好友等,SDK 会作为通知事件下发,上层通过 JMSGEventDelegate 类的代理方法可监听此类事件.
251-
*
252-
* #### 注意:
253-
*
254-
* 1、事件分类详细说明 和 事件对应监听方法请查看 JMSGNotificationEvent 类
255-
*
256-
* 2、不要直接使用数字来判断事件类型
250+
* 如:被踢、加好友等,SDK 会作为通知事件下发,上层通过 JMSGEventDelegate、JMSGGroupDelegate 这些对应类的代理方法可监听此类事件.
257251
*/
258252
typedef NS_ENUM(NSInteger, JMSGEventNotificationType) {
259-
260-
// 用户登录状态变更事件
261-
/// 事件类型: 登录被踢
262-
kJMSGEventNotificationLoginKicked = 1,
263-
/// 事件类型: 非客户端修改密码强制登出事件
264-
kJMSGEventNotificationServerAlterPassword = 2,
265-
/// 事件类型:用户登录状态异常事件(需要重新登录)
266-
kJMSGEventNotificationUserLoginStatusUnexpected = 70,
267-
/// 事件类型:当前登录用户信息变更通知事件(非客户端修改)
268-
kJMSGEventNotificationCurrentUserInfoChange = 40,
269-
/// 事件类型:当前登录用户被删除事件(本地用户信息会被清空)
270-
kJMSGEventNotificationCurrentUserDeleted = 10001,
271-
/// 事件类型:当前登录用户被禁用事件(本地用户信息会被清空)
272-
kJMSGEventNotificationCurrentUserDisabled = 10002,
273-
274253
// 消息事件
275254
/// 事件类型: 群组被创建
276255
kJMSGEventNotificationCreateGroup = 8,
@@ -294,8 +273,49 @@ typedef NS_ENUM(NSInteger, JMSGEventNotificationType) {
294273
kJMSGEventNotificationDissolveGroup = 11001,
295274
/// 事件类型: 群组成员上限变更
296275
kJMSGEventNotificationGroupMaxMemberCountChange = 11002,
297-
298-
276+
};
277+
278+
/*!
279+
* 通知事件类型
280+
*
281+
* #### 上层通过 JMSGEventDelegate 类里的方法来监听此类事件
282+
*/
283+
typedef NS_ENUM(NSInteger, JMSGCommonEventType){
284+
/// 事件类型: 消息撤回
285+
kJMSGEventNotificationMessageRetract = 55,
286+
/// 事件类型: 消息透传
287+
kJMSGEventNotificationMessageTransparent = 12001,
288+
/// 事件类型: 消息回执变更
289+
kJMSGEventNotificationMessageReceiptStatusChange = 12002,
290+
};
291+
292+
/*!
293+
* 用户登录状态变更事件类型
294+
*
295+
* #### 上层通过 JMSGUserDelegate 类里的方法来监听此类事件
296+
*/
297+
typedef NS_ENUM(NSInteger, JMSGLoginStatusChangeEventType) {
298+
// 用户登录状态变更事件
299+
/// 事件类型: 登录被踢
300+
kJMSGEventNotificationLoginKicked = 1,
301+
/// 事件类型: 非客户端修改密码强制登出事件
302+
kJMSGEventNotificationServerAlterPassword = 2,
303+
/// 事件类型:用户登录状态异常事件(需要重新登录)
304+
kJMSGEventNotificationUserLoginStatusUnexpected = 70,
305+
/// 事件类型:当前登录用户信息变更通知事件(非客户端修改)
306+
kJMSGEventNotificationCurrentUserInfoChange = 40,
307+
/// 事件类型:当前登录用户被删除事件(本地用户信息会被清空)
308+
kJMSGEventNotificationCurrentUserDeleted = 10001,
309+
/// 事件类型:当前登录用户被禁用事件(本地用户信息会被清空)
310+
kJMSGEventNotificationCurrentUserDisabled = 10002,
311+
};
312+
313+
/*!
314+
* 好友事件类型
315+
*
316+
* #### 上层通过 JMSGEventDelegate 类里的方法来监听此类事件
317+
*/
318+
typedef NS_ENUM(NSInteger, JMSGFriendEventType) {
299319
// 好友相关事件
300320
/// 事件类型: 收到好友邀请
301321
kJMSGEventNotificationReceiveFriendInvitation = 51,
@@ -307,13 +327,40 @@ typedef NS_ENUM(NSInteger, JMSGEventNotificationType) {
307327
kJMSGEventNotificationDeletedFriend = 6,
308328
/// 事件类型:非客户端修改好友关系收到好友更新事件
309329
kJMSGEventNotificationReceiveServerFriendUpdate = 7,
310-
311-
/// 事件类型: 消息撤回
312-
kJMSGEventNotificationMessageRetract = 55,
313-
/// 事件类型: 消息透传
314-
kJMSGEventNotificationMessageTransparent = 12001,
315-
/// 事件类型: 消息回执变更
316-
kJMSGEventNotificationMessageReceiptStatusChange = 12002,
330+
};
331+
332+
/*!
333+
* 群组事件类型
334+
*
335+
* #### 上层通过 JMSGGroupDelegate 类里的方法来监听此类事件
336+
*/
337+
typedef NS_ENUM(NSInteger, JMSGGroupEventType) {
338+
/// 事件类型:发布群公告
339+
kJMSGEventNotificationPublishGroupAnnouncement = 86,
340+
/// 事件类型:删除群公告
341+
kJMSGEventNotificationDeleteGroupAnnouncement = 87,
342+
/// 事件类型:置顶/取消置顶 群公告
343+
kJMSGEventNotificationTopGroupAnnouncement = 88,
344+
/// 事件类型:添加群组黑名单
345+
kJMSGEventNotificationAddGroupBlacklist = 89,
346+
/// 事件类型:删除群组黑名单
347+
kJMSGEventNotificationDelGroupBlacklist = 90,
348+
};
349+
350+
/*!
351+
* 聊天室事件类型
352+
*
353+
* #### 上层通过 JMSGEventDelegate 类里的方法来监听此类事件
354+
*/
355+
typedef NS_ENUM(NSInteger, JMSGChatRoomEventType) {
356+
/// 事件类型:添加管理员
357+
kJMSGEventNotificationChatRoomAddAdmin = 130,
358+
/// 事件类型:删除管理员
359+
kJMSGEventNotificationChatRoomDelAdmin = 131,
360+
/// 事件类型:添加黑名单
361+
kJMSGEventNotificationChatRoomAddBlacklist = 132,
362+
/// 事件类型:删除黑名单
363+
kJMSGEventNotificationChatRoomDelBlacklist = 133,
317364
};
318365

319366
///----------------------------------------------------
@@ -427,6 +474,8 @@ typedef NS_ENUM(NSInteger, JMSGSDKErrorCode) {
427474
kJMSGErrorSDKMessageProtocolUpgradeNeeded = 865008,
428475
/// 收到不支持消息内容类型(建议升级)
429476
kJMSGErrorSDKMessageProtocolContentTypeNotSupport = 865009,
477+
/// 消息状态不合法
478+
kJMSGErrorSDKMessageStatusNotLegal = 865010,
430479

431480

432481
// ------------------------ Conversation (866xxx)
@@ -534,8 +583,16 @@ typedef NS_ENUM(NSUInteger, JMSGTcpErrorCode) {
534583
kJMSGErrorTcpGroupMembersDuplicated = 810007,
535584
/// 重复申请入群或重复邀请成员入群
536585
kJMSGErrorTcpGroupApplyRepeat = 856003,
537-
/// 用在聊天室中被禁言
586+
/// 用户在聊天室中被禁言
538587
kJMSGErrorTcpUserBannedInChatRoom = 847002,
588+
/// 用户已经在聊天室黑名单中
589+
kJMSGErrorTcpUserHasInChatRoomBlacklist = 7132006,
590+
/// 目标用户不在聊天室黑名单里
591+
kJMSGErrorTcpUserNotInChatRoomBlacklist = 7133001,
592+
/// 用户已经在聊天室管理员列表中
593+
kJMSGErrorTcpUserHasInChatRoomAdminList = 7130002,
594+
/// 目标用户不在聊天室管理员列表里
595+
kJMSGErrorTcpUserNotInChatRoomAdminList = 7131002,
539596
};
540597

541598

ios/RCTJMessageModule/JMessage.framework/Headers/JMSGConversation.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#import <JMessage/JMSGConstants.h>
1414
#import <JMessage/JMSGUser.h>
1515
#import <JMessage/JMSGGroup.h>
16+
#import <JMessage/JMSGChatRoom.h>
1617

1718
@class JMSGMessage;
1819
@class JMSGAbstractContent;

ios/RCTJMessageModule/JMessage.framework/Headers/JMSGConversationDelegate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,6 @@
9292
* @param newCount 变更后的数量
9393
*/
9494
@optional
95-
- (void)onUnreadChanged:(NSUInteger)newCount;
95+
- (void)onUnreadChanged:(NSUInteger)newCount __attribute__((deprecated("deprecated")));
9696
@end
9797

ios/RCTJMessageModule/JMessage.framework/Headers/JMSGEventDelegate.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,27 @@
6464
@optional
6565
- (void)onReceiveMessageTransparentEvent:(JMSGMessageTransparentEvent *)transparentEvent;
6666

67+
/*!
68+
* @abstract 聊天室管理员变更通知
69+
*
70+
* @param event 管理员事件列表
71+
*
72+
* @discussion 事件具体相关属性请查看 JMSGChatRoomAdminChangeEvent 类
73+
*
74+
* @since 3.8.0
75+
*/
76+
- (void)onReceiveChatRoomAdminChangeEvents:(NSArray<__kindof JMSGChatRoomAdminChangeEvent*>*)events;
77+
78+
/*!
79+
* @abstract 聊天室黑名单变更通知
80+
*
81+
* @param event 黑名单事件列表
82+
*
83+
* @discussion 事件具体相关属性请查看 JMSGChatRoomBlacklisChangetEvent 类
84+
*
85+
* @since 3.8.0
86+
*/
87+
- (void)onReceiveChatRoomBlacklistChangeEvents:(NSArray<__kindof JMSGChatRoomBlacklisChangetEvent*>*)events;
6788

6889

6990
///----------------------------------------------------

0 commit comments

Comments
 (0)