fix: 升级到1.0.4

This commit is contained in:
tangtaoit 2023-07-12 11:59:40 +08:00
parent 8d0bec3646
commit ec38d8b53e
14 changed files with 110 additions and 24 deletions

View File

@ -6,3 +6,21 @@ https://githubim.com
pod spec lint --verbose --allow-warnings
pod trunk push WuKongIMSDK.podspec --allow-warnings
xcode14.3打包错误临时解决方案
Go to System Preferences → Security & Privacy → Full Disk Access → Terminal, and do:
cd /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/
sudo mkdir arc
cd arc
sudo git clone https://github.com/kamyarelyasi/Libarclite-Files.git .
sudo chmod +x *
https://stackoverflow.com/questions/75574268/missing-file-libarclite-iphoneos-a-xcode-14-3/75729977#75729977
正式解决方案等CocoaPods官方https://github.com/CocoaPods/CocoaPods/issues/11839

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'WuKongIMSDK'
s.version = '1.0.3'
s.version = '1.0.4'
s.summary = '悟空IM是一款简单高效支持完全私有化的即时通讯.'
s.license = {"type"=>"MIT", "file"=>"ios/LICENSE"}
s.authors = {"tangtaoit"=>"tt@tgo.ai"}

View File

@ -160,11 +160,22 @@ typedef BOOL(^MessageStoreBeforeIntercept)(WKMessage*message);
/**
@param channel
@param endOrderSeq orderSeq0
@param limit
@param complete
@param alwayRequest
*/
-(void) pullLastMessages:(WKChannel*)channel limit:(int)limit alwayRequest:(BOOL)alwayRequest complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
-(void) pullLastMessages:(WKChannel*)channel endOrderSeq:(uint32_t)endOrderSeq limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
/**
@param channel
@param endOrderSeq orderSeq0
@param maxMessageSeq messageSeqmessageSeq 0
@param limit
@param complete
*/
-(void) pullLastMessages:(WKChannel*)channel endOrderSeq:(uint32_t)endOrderSeq maxMessageSeq:(uint32_t)maxMessageSeq limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
/**
@ -183,6 +194,8 @@ typedef BOOL(^MessageStoreBeforeIntercept)(WKMessage*message);
*/
-(void) pullUp:(WKChannel*)channel startOrderSeq:(uint32_t)startOrderSeq limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
-(void) pullUp:(WKChannel*)channel startOrderSeq:(uint32_t)startOrderSeq endOrderSeq:(uint32_t)endOrderSeq limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
/**
orderSeq周围的消息 55 orderSeq 20 16 17 18 19 20 21 22 23 24 25 使
@param channel
@ -190,7 +203,13 @@ typedef BOOL(^MessageStoreBeforeIntercept)(WKMessage*message);
*/
-(void) pullAround:(WKChannel*)channel orderSeq:(uint32_t)orderSeq limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
/**
orderSeq周围的消息 55 orderSeq 20 16 17 18 19 20 21 22 23 24 25 使
@param channel
@param orderSeq OrderSeq查询周围的消息
@param maxMessageSeq messageSeq
*/
-(void) pullAround:(WKChannel*)channel orderSeq:(uint32_t)orderSeq maxMessageSeq:(uint32_t)maxMessageSeq limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
/**
@ -201,7 +220,7 @@ typedef BOOL(^MessageStoreBeforeIntercept)(WKMessage*message);
@param pullMode
@param complete
*/
-(void) pullMessages:(WKChannel*)channel startOrderSeq:(uint32_t)startOrderSeq endOrderSeq:(uint32_t)endOrderSeq limit:(int)limit pullMode:(WKPullMode)pullMode complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete DEPRECATED_MSG_ATTRIBUTE("use pullDown or pullUp");
-(void) pullMessages:(WKChannel*)channel startOrderSeq:(uint32_t)startOrderSeq endOrderSeq:(uint32_t)endOrderSeq limit:(int)limit pullMode:(WKPullMode)pullMode complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
/**
@ -384,7 +403,8 @@ typedef BOOL(^MessageStoreBeforeIntercept)(WKMessage*message);
/// 清除所有消息
-(void) onMessageAllCleared;
// 流消息
-(void) onMessageStream:(WKStream*)stream;
@end

View File

@ -51,6 +51,9 @@
/// @param messages <#messages description#>
- (void)callRecvMessagesDelegate:(NSArray<WKMessage*>*)messages;
// 调用流式消息委托
- (void)callStreamDelegate:(NSArray<WKStream*>*)streams;
/// 获取所有消息存储之前的拦截器
-(NSArray<MessageStoreBeforeIntercept>*) getMessageStoreBeforeIntercepts;

View File

@ -66,8 +66,7 @@ typedef enum : uint8_t {
// 协议类型
typedef enum : NSUInteger {
WK_PROTO_WKAO,
WK_PROTO_MOS
WK_PROTO_WK,
} WKProto;

View File

@ -11,6 +11,8 @@
//消息表
#define TB_MESSAGE @"message"
#define TB_STREAM @"stream"
NS_ASSUME_NONNULL_BEGIN
@interface WKDB : NSObject

View File

@ -15,6 +15,8 @@
#import "WKSetting.h"
#import "WKMessageExtra.h"
#import "WKReaction.h"
#import "WKStream.h"
#import "WKRecvPacket.h"
NS_ASSUME_NONNULL_BEGIN
@interface WKMessageHeader : NSObject
@ -39,6 +41,12 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,copy) NSString *clientMsgNo; /// 客户端消息唯一编号(相同clientMsgNo被认为是重复消息)
@property(nonatomic,copy) NSString *streamNo; // 流式编号
@property(nonatomic,assign) WKStreamFlag streamFlag; // 流式标记
@property(nonatomic,assign) uint64_t streamSeq; // 流式序号
@property(nonatomic,assign) uint64_t messageId; // 消息ID全局唯一
@property(nonatomic,assign) uint32_t messageSeq; // 消息序列号(用户唯一,有序)
@ -85,18 +93,12 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,assign) NSInteger viewedAt; // 查看时间戳
@property(nonatomic,strong) WKMessageExtra *remoteExtra; // 消息远程扩展
//
//@property(nonatomic,assign) BOOL revoke; // 消息是否被撤回
//@property(nonatomic,copy) NSString *revoker; // 撤回者的uid
//@property(nonatomic,assign) NSInteger unreadCount; // 未读数量
//@property(nonatomic,assign) NSInteger readedCount; // 已读数量
//@property(nonatomic,assign) NSInteger extraVersion; // 扩展消息版本
//@property(nonatomic,assign) BOOL readed; // 消息是否已读(“我”是否已读)
//@property(nonatomic,strong,nullable) NSData *contentEditData; // 消息编辑后的正文data数据
//@property(nonatomic,strong,nullable) WKMessageContent *contentEdit; // 消息编辑后的正文
//@property(nonatomic,assign) NSInteger editedAt; // 消息编辑时间 0表示消息未被编辑
//@property(nonatomic,assign) BOOL isEdit; // 是否编辑
//@property(nonatomic,assign) BOOL needUpload; // 编辑内容是否需要上传
@property(nonatomic,assign) BOOL syncStreamsFromDB; // 是否从db同步流数据
@property(nonatomic,strong) NSMutableArray<WKStream*> *streams; // 流式消息内容
@property(nonatomic,assign) BOOL streamOn; // 是否开启了stream
@end

View File

@ -289,6 +289,13 @@ NS_ASSUME_NONNULL_BEGIN
-(uint32_t) getChannelAroundFirstMessageSeq:(WKChannel*)channel messageSeq:(uint32_t)messageSeq;
-(WKMessageContent*) decodeContent:(NSInteger)contentType data:(NSData *)contentData db:(FMDatabase*)db;
// 保存流
-(void) saveOrUpdateStreams:(NSArray<WKStream*>*)streams;
// 获取流
-(NSArray<WKStream*>*) getStreams:(NSString*)streamNo;
@end
NS_ASSUME_NONNULL_END

View File

@ -34,8 +34,6 @@ typedef WKConnectInfo*_Nonnull(^WKConnectInfoCallback)(void);
@property(nonatomic,assign) uint16_t port;
/// IM模式
@property(nonatomic,assign) WKMode mode;
/**
*/
@ -129,7 +127,6 @@ typedef WKConnectInfo*_Nonnull(^WKConnectInfoCallback)(void);
/// 协议类型
@property(nonatomic,assign) WKProto proto;
@property(nonatomic,assign) BOOL mosConvertOn; // 是否开启mos的content转换临时参数
@property(nonatomic,assign) NSInteger messageExtraSyncLimit; // 同步扩展消息每次数量限制

View File

@ -11,6 +11,12 @@
#import "WKSetting.h"
NS_ASSUME_NONNULL_BEGIN
typedef enum : NSUInteger {
WKStreamFlagStart,
WKStreamFlagIng,
WKStreamFlagEnd,
} WKStreamFlag;
@interface WKRecvPacket : WKPacket<WKPacketBodyCoder>
// 消息设置
@ -21,6 +27,12 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,assign) uint32_t messageSeq;
// 客户端消息唯一编号(用于消息去重)
@property(nonatomic,copy) NSString *clientMsgNo;
// 流式编号
@property(nonatomic,copy) NSString *streamNo;
// 流式标记
@property(nonatomic,assign) WKStreamFlag streamFlag;
// 流式序号
@property(nonatomic,assign) uint64_t streamSeq;
// 服务器时间
@property(nonatomic,assign) uint32_t timestamp;
// 发送者UID

View File

@ -18,6 +18,7 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,assign) BOOL topic; // 是否存在话题
@property(nonatomic,assign) BOOL streamOn; // 是否开启流式消息
-(uint8_t) toUint8;

View File

@ -0,0 +1,25 @@
//
// WKStream.h
// WuKongIMSDK
//
// Created by tt on 2023/7/3.
//
#import <Foundation/Foundation.h>
#import "WKChannel.h"
#import "WKMessageContent.h"
NS_ASSUME_NONNULL_BEGIN
@interface WKStream : NSObject
@property(nonatomic,strong) WKChannel *channel;
@property(nonatomic,copy) NSString *clientMsgNo;
@property(nonatomic,copy) NSString *streamNo;
@property(nonatomic,assign) uint64_t streamSeq;
@property(nonatomic,strong) WKMessageContent *content; // 消息正文
@property(nonatomic,strong) NSData *contentData; // 消息正文data数据
@end
NS_ASSUME_NONNULL_END

View File

@ -13,7 +13,6 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic,assign) uint32_t startMessageSeq; // 开始消息序列号
@property(nonatomic,assign) uint32_t endMessageSeq; // 结束消息序列号
@property(nonatomic,assign) BOOL more; // 是否还有更多数据
@property(nonatomic,strong) NSArray<WKMessage*> *messages; // 消息集合
@end

View File

@ -88,6 +88,7 @@
#import "WKReaction.h"
#import "WKReminder.h"
#import "WKRobot.h"
#import "WKStream.h"
#import "WKSyncChannelMessageModel.h"
#import "WKSyncConversationModel.h"
#import "WKTaskOperator.h"