Skip to content

Commit 3ec27f5

Browse files
committed
update ios sdk to 3.3.0
1 parent 91444d1 commit 3ec27f5

16 files changed

+453
-74
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,10 @@ typedef NS_ENUM(NSInteger, JMSGEventNotificationType) {
212212

213213
/// 事件类型: 消息撤回
214214
kJMSGEventNotificationMessageRetract = 55,
215+
/// 事件类型: 消息透传
216+
kJMSGEventNotificationMessageTransparent = 58,
217+
/// 事件类型: 消息回执变更
218+
kJMSGEventNotificationMessageReceiptStatusChange = 68,
215219

216220
// 消息事件
217221
/// 事件类型: 群组被创建
@@ -314,6 +318,8 @@ typedef NS_ENUM(NSInteger, JMSGSDKErrorCode) {
314318
kJMSGErrorSDKMediaHashCodeIllegal = 864006,
315319
/// 媒体HASH校验失败
316320
kJMSGErrorSDKMediaHashVerifyFailed = 864007,
321+
/// 这条消息不支持转发
322+
kJMSGErrorSDKMessageNotSupportForward = 864008,
317323

318324
// ------------------------ Message (865xxx)
319325

@@ -413,6 +419,8 @@ typedef NS_ENUM(NSUInteger, JMSGTcpErrorCode) {
413419
kJMSGErrorTcpUserNotRegistered = 801003,
414420
/// 用户密码错误
415421
kJMSGErrorTcpUserPasswordError = 801004,
422+
/// 多通道同时登录错误,登录失败
423+
kJMSGErrorTcpLoginMultiChannelError = 801007,
416424
/// 目标用户不存在
417425
kJMSGErrorTcpTargetUserNotExist = 803003,
418426
/// 目标群组不存在
@@ -455,14 +463,6 @@ static NSString *const KEY_REGION = @"region"; //区域
455463
static NSString *const KEY_SIGNATURE = @"signature";//签名
456464
static NSString *const KEY_ADDRESS = @"address"; //地址
457465
static NSString *const KEY_STAR = @"star";
458-
static NSString *const KEY_UID = @"uid";
459-
static NSString *const KEY_NO_DISTURB = @"no_disturb";
460-
static NSString *const KEY_BLACKLIST = @"blicklist";
461-
static NSString *const KEY_NOTE_NAME = @"memo_name";//note_name
462-
static NSString *const KEY_NOTE_TEXT = @"memo_others";//note_text
463-
static NSString *const KEY_SHIELD_GROUP = @"shield_group";
464-
static NSString *const KEY_USER_MTIME = @"mtime";
465-
static NSString *const KEY_USER_CTIME = @"ctime";
466466

467467

468468

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

Lines changed: 61 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
@class JMSGAbstractContent;
1818
@class JMSGImageContent;
1919
@class JMSGOptionalContent;
20+
@class JMSGMediaAbstractContent;
2021

2122

2223
/*!
@@ -218,6 +219,7 @@ JMSG_ASSUME_NONNULL_BEGIN
218219
@property(nonatomic, strong, readonly) NSString *targetAppKey;
219220

220221

222+
221223
///----------------------------------------------------
222224
/// @name Message Operations 消息相关操作
223225
///----------------------------------------------------
@@ -311,16 +313,24 @@ JMSG_ASSUME_NONNULL_BEGIN
311313
*/
312314
- (JMSGMessage * JMSG_NULLABLE)createMessageWithContent:(JMSGAbstractContent *)content;
313315

316+
314317
/*!
315318
* @abstract 创建消息对象(图片,异步)
316319
*
317-
* @param content 准备好的图片内容
320+
* 注意:此方法已过期,请使用 createMessageAsyncWithMediaContent: 方法
321+
*/
322+
- (void)createMessageAsyncWithImageContent:(JMSGImageContent *)content
323+
completionHandler:(JMSGCompletionHandler JMSG_NULLABLE)handler __attribute__((deprecated("first deprecated in JMessage 3.3.0 - Use -createMessageAsyncWithMediaContent:")));
324+
/*!
325+
* @abstract 创建消息对象(多媒体消息,异步)
326+
*
327+
* @param content 准备好的多媒体内容,如:图片、语音、文件等
318328
* @param handler 结果回调. 正常返回时 resultObject 类型为 JMSGMessage.
319329
*
320-
* @discussion 对于图片消息,因为 SDK 要做缩图有一定的性能损耗,图片文件很大时存储落地也会较慢。
330+
* @discussion 注意:对于多媒体消息,因为 SDK 要做缩图有一定的性能损耗,图片文件很大时存储落地也会较慢。
321331
* 所以创建图片消息,建议使用这个异步接口。
322332
*/
323-
- (void)createMessageAsyncWithImageContent:(JMSGImageContent *)content
333+
- (void)createMessageAsyncWithMediaContent:(JMSGMediaAbstractContent *)content
324334
completionHandler:(JMSGCompletionHandler JMSG_NULLABLE)handler;
325335

326336
/*!
@@ -333,12 +343,12 @@ JMSG_ASSUME_NONNULL_BEGIN
333343
- (void)sendMessage:(JMSGMessage *)message;
334344

335345
/*!
336-
* @abstract 发送消息(附带可选功能,如:控制离线消息存储、自定义通知栏内容等
346+
* @abstract 发送消息(附带可选功能,如:控制离线消息存储、自定义通知栏内容、消息已读回执等
337347
*
338348
* @param message 通过消息创建类接口,创建好的消息对象
339349
* @param optionalContent 可选功能,具体请查看 JMSGOptionalContent 类
340350
*
341-
* @discussion 可选功能里可以设置离线消息存储、自定义通知栏内容等,具体请查看 JMSGOptionalContent 类。
351+
* @discussion 可选功能里可以设置离线消息存储、自定义通知栏内容、消息已读回执等,具体请查看 JMSGOptionalContent 类。
342352
*
343353
*/
344354
- (void)sendMessage:(JMSGMessage *)message optionalContent:(JMSGOptionalContent *)optionalContent;
@@ -421,7 +431,23 @@ JMSG_ASSUME_NONNULL_BEGIN
421431
- (void)retractMessage:(JMSGMessage *)message completionHandler:(JMSGCompletionHandler)handler;
422432

423433
/*!
424-
* @abstract 异步获取会话头像(仅限单聊)
434+
* @abstract 消息透传
435+
*
436+
* @param transparentText 用户自定义透传内容,仅限 NSString 类型
437+
* @param handler 回调,error=nil 表示成功
438+
*
439+
* @discussion 注意:
440+
*
441+
* 1. 消息透传功能,消息不会进入到后台的离线存储中去,仅当对方用户当前在线时才会成功送达,可以快速响应,方便开发者拓展自定义行为;
442+
*
443+
* 2. 可用来快速实现一些在线场景下的辅助功能 :输入状态提示、位置信息提示、开发者自定义等。
444+
*
445+
*/
446+
- (void)sendTransparentMessage:(NSString *JMSG_NONNULL)transparentText
447+
completionHandler:(JMSGCompletionHandler JMSG_NULLABLE)handler;
448+
449+
/*!
450+
* @abstract 异步获取会话头像
425451
*
426452
* @param handler 结果回调。回调参数:
427453
*
@@ -443,7 +469,7 @@ JMSG_ASSUME_NONNULL_BEGIN
443469
*
444470
* @return 返回本地路,返回值只有在下载完成之后才有意义
445471
*/
446-
- (NSString *)avatarLocalPath;
472+
- (NSString *JMSG_NULLABLE)avatarLocalPath;
447473

448474
///----------------------------------------------------
449475
/// @name Conversation State Maintenance 会话状态维护
@@ -463,6 +489,34 @@ JMSG_ASSUME_NONNULL_BEGIN
463489
*/
464490
- (NSString *)latestMessageContentText;
465491

492+
/*!
493+
* @abstract 获取会话所有扩展字段
494+
*
495+
* @return 返回所有值,NSDictionary 类型
496+
*
497+
* @discussion 与 [- (void)setExtraValue:forKey:] 配套使用,可用于对会话属性的扩展
498+
*/
499+
- (NSDictionary *JMSG_NULLABLE)getConversationExtras;
500+
501+
/*!
502+
* @abstract 获取单个扩展字段
503+
*
504+
* @return 返回 key 对应值,NSString 类型
505+
*
506+
* @discussion 与 [- (void)setExtraValue:forKey:] 配套使用,可用于对会话属性的扩展
507+
*/
508+
- (NSString *JMSG_NULLABLE)getExtraValueForKey:(NSString *JMSG_NONNULL)key;
509+
510+
/*!
511+
* @abstract 增加或更新扩展字段,可扩展会话属性,比如:会话置顶、标识特殊会话等
512+
*
513+
* @param value 新增键值对的值. String 类型.
514+
* @param key 新增键值对的键
515+
*
516+
* @discussion 如果 value = nil,则删除 extras 中 key 对应的值
517+
*/
518+
- (void)setExtraValue:(NSString *JMSG_NULLABLE)value forKey:(NSString *JMSG_NONNULL)key;
519+
466520
/*!
467521
* @abstract 判断消息是否属于这个 Conversation
468522
*

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737
- (void)onUnreadChanged:(NSUInteger)newCount;
3838

3939
/*!
40-
* @abstract 同步离线消息通知
40+
* @abstract 同步离线消息、离线事件通知
4141
*
4242
* @param conversation 同步离线消息的会话
43-
* @param offlineMessages 离线消息数组
43+
* @param offlineMessages 离线消息、离线事件数组
4444
*
4545
* @discussion 注意:
4646
*
@@ -53,11 +53,12 @@
5353
*
5454
* 3.1.0 版本之后: SDK 会以会话为单位,不管该会话有多少离线消息,SDK同步完成后每个会话只上抛一次.
5555
*
56-
* 注意一个会话只会上抛一个会话,这样会大大减轻上层在收到消息事件需要刷新 UI 的应用场景下,UI 刷新的压力.
56+
* 3.2.1 版本之后: SDK 会以会话为单位,不管该会话有多少离线事件,SDK同步完成后每个会话只上抛一次
57+
*
58+
* 注意:一个会话最多触发两次这个代理,即:离线消息和离线事件各一次,这样会大大减轻上层在收到消息刷新 UI 的压力.
5759
*
5860
* 上层通过此代理方法监听离线消息同步的会话,详见官方文档.
5961
*
60-
* @since 3.1.0
6162
*/
6263
@optional
6364
- (void)onSyncOfflineMessageConversation:(JMSGConversation *)conversation

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

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,34 @@
3939
*
4040
* @param retractEvent 下发的通知事件,事件类型请查看 JMSGMessageRetractEvent 类
4141
*
42-
* @discussion 收到此事件时,可以通过 event.conversation 判断是否属于某个会话
43-
*
4442
* @since 3.2.0
4543
*/
4644
@optional
4745
- (void)onReceiveMessageRetractEvent:(JMSGMessageRetractEvent *)retractEvent;
46+
47+
/*!
48+
* @abstract 消息回执状态变更事件
49+
*
50+
* @param receiptEvent 下发的通知事件,事件类型请查看 JMSGMessageReceiptStatusChangeEvent 类
51+
*
52+
* @discussion 上层可以通过 receiptEvent 获取相应信息
53+
*
54+
* @since 3.3.0
55+
*/
56+
@optional
57+
- (void)onReceiveMessageReceiptStatusChangeEvent:(JMSGMessageReceiptStatusChangeEvent *)receiptEvent;
58+
59+
/*!
60+
* @abstract 消息透传事件
61+
*
62+
* @param transparentEvent 下发的通知事件,事件类型请查看 JMSGMessageTransparentEvent 类
63+
*
64+
* @discussion 上层可以通过 transparentEvent 获取相应信息,如果自定义的透传信息、会话
65+
*
66+
* @since 3.3.0
67+
*/
68+
@optional
69+
- (void)onReceiveMessageTransparentEvent:(JMSGMessageTransparentEvent *)transparentEvent;
70+
4871
@end
4972

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,25 @@ JMSG_ASSUME_NONNULL_BEGIN
3939
*/
4040
- (void)fileData:(JMSGAsyncDataHandler)handler;
4141

42+
/*!
43+
* @abstract 获取文件内容的数据
44+
*
45+
* @param progressHandler 下载进度。会持续回调更新进度, 直接下载完成。如果为 nil 则表示不关心进度。
46+
* @param handler 结果回调。回调参数:
47+
*
48+
* - data 文件数据;
49+
* - objectId 消息msgId;
50+
* - error 不为nil表示出错;
51+
*
52+
* 如果 error 为 ni, data 也为 nil, 表示没有数据.
53+
*
54+
* @discussion
55+
* 如果本地数据文件已经存在, 则直接返回;
56+
* 如果本地还没有文件,会发起网络请求下载。下载完后再回调。
57+
*/
58+
- (void)fileDataWithProgress:(JMSGMediaProgressHandler JMSG_NULLABLE)progressHandler
59+
completionHandler:(JMSGAsyncDataHandler JMSG_NULLABLE)handler;
60+
4261
JMSG_ASSUME_NONNULL_END
4362

4463
@end

0 commit comments

Comments
 (0)