mirror of
https://github.com/WuKongIM/WuKongIMiOSSDK-Framework
synced 2025-05-19 14:42:34 +00:00
init
This commit is contained in:
commit
7b0c1bc743
9
README.md
Normal file
9
README.md
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
LiMaoIM 即时通讯的iOS SDK 详细使用请参考
|
||||
|
||||
http://docs.limaoim.cn/
|
||||
|
||||
|
||||
pod spec lint --verbose
|
||||
|
||||
pod trunk push LiMaoIMSDK.podspec --allow-warnings
|
27
WuKongIMSDK.podspec
Normal file
27
WuKongIMSDK.podspec
Normal file
@ -0,0 +1,27 @@
|
||||
Pod::Spec.new do |s|
|
||||
s.name = 'WuKongIMSDK'
|
||||
s.version = '1.0.0'
|
||||
s.summary = '悟空IM是一款简单,高效,支持完全私有化的即时通讯.'
|
||||
s.license = {"type"=>"MIT", "file"=>"ios/LICENSE"}
|
||||
s.authors = {"tangtaoit"=>"tt@tgo.ai"}
|
||||
s.homepage = 'https://githubim.com'
|
||||
s.description = '悟空IM是一款简单,高效,支持完全私有化的即时通讯,提供群聊,点对点通讯解决方案'
|
||||
s.frameworks = ["UIKit", "MapKit","AVFoundation"]
|
||||
# s.libraries = ["opencore-amrnb", "opencore-amrwb", "vo-amrwbenc"]
|
||||
s.ios.libraries = ['c++','sqlite3','z']
|
||||
s.source = { :git => "https://gitee.com/WuKongIM/WuKongIMiOSSDK-Framework.git",:tag => "#{s.version}" }
|
||||
s.requires_arc = true
|
||||
s.ios.deployment_target = '12.0'
|
||||
s.platform = :ios, '12.0'
|
||||
s.resource = 'ios/WuKongIMSDK.framework/WuKongIMSDK.bundle'
|
||||
s.vendored_frameworks = 'ios/WuKongIMSDK.framework'
|
||||
s.xcconfig = {
|
||||
'OTHER_LDFLAGS' => '-ObjC',
|
||||
"LIBRARY_SEARCH_PATHS"=>"${PODS_ROOT}/../../WuKongIMiOSSDK-Framework/ios/lib",
|
||||
'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'arm64',
|
||||
|
||||
}
|
||||
s.dependency 'CocoaAsyncSocket', '~> 7.6.4'
|
||||
s.dependency 'FMDB/SQLCipher', '~>2.7.5'
|
||||
s.dependency '25519', '~>2.0.2'
|
||||
end
|
BIN
ios/.DS_Store
vendored
Normal file
BIN
ios/.DS_Store
vendored
Normal file
Binary file not shown.
201
ios/LICENSE
Normal file
201
ios/LICENSE
Normal file
@ -0,0 +1,201 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
27
ios/WuKongIMSDK.framework/Headers/WKAESUtil.h
Normal file
27
ios/WuKongIMSDK.framework/Headers/WKAESUtil.h
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// WKAESUtil.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/2/25.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <CommonCrypto/CommonDigest.h>
|
||||
#import <CommonCrypto/CommonCryptor.h>
|
||||
|
||||
/**
|
||||
* AES工具类
|
||||
*/
|
||||
@interface WKAESUtil : NSObject
|
||||
|
||||
/**
|
||||
* AES加密
|
||||
*/
|
||||
+ (NSString *)aesEncrypt:(NSString *)sourceStr key:(NSString*)key iv:(NSString*)iv;
|
||||
|
||||
/**
|
||||
* AES解密
|
||||
*/
|
||||
+ (NSString *)aesDecrypt:(NSString *)secretStr key:(NSString*)key iv:(NSString*)iv;
|
||||
|
||||
@end
|
26
ios/WuKongIMSDK.framework/Headers/WKBaseTask.h
Normal file
26
ios/WuKongIMSDK.framework/Headers/WKBaseTask.h
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// WKBaseTask.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/16.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKTaskProto.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKBaseTask : NSObject<WKTaskProto>
|
||||
|
||||
/**
|
||||
错误 如果任务下载失败,则有值
|
||||
*/
|
||||
@property(nullable,nonatomic,strong) NSError *error;
|
||||
|
||||
/**
|
||||
下载进度
|
||||
*/
|
||||
@property(nonatomic,assign) CGFloat progress;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
30
ios/WuKongIMSDK.framework/Headers/WKCMDContent.h
Normal file
30
ios/WuKongIMSDK.framework/Headers/WKCMDContent.h
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// WKCMDContent.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/31.
|
||||
//
|
||||
|
||||
#import "WKMediaMessageContent.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKCMDContent : WKMessageContent
|
||||
|
||||
|
||||
/**
|
||||
cmd
|
||||
*/
|
||||
@property(nonatomic,copy) NSString *cmd;
|
||||
|
||||
/**
|
||||
cmd参数
|
||||
*/
|
||||
@property(nonatomic,copy) id param;
|
||||
|
||||
// cmd验证字段 ,校验是否是服务端下发
|
||||
@property(nonatomic,copy) NSString *sign; // 签名字符串签出来的sign
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
50
ios/WuKongIMSDK.framework/Headers/WKCMDDB.h
Normal file
50
ios/WuKongIMSDK.framework/Headers/WKCMDDB.h
Normal file
@ -0,0 +1,50 @@
|
||||
//
|
||||
// WKCMDDB.h
|
||||
// WuKongIMSDK-WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/11/21.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKCMDMessage : NSObject
|
||||
|
||||
@property(nonatomic,assign) NSInteger mid;
|
||||
|
||||
/// 客户端消息唯一编号(相同clientMsgNo被认为是重复消息)
|
||||
@property(nonatomic,copy) NSString *clientMsgNo;
|
||||
// 消息ID(全局唯一)
|
||||
@property(nonatomic,assign) uint64_t messageId;
|
||||
// 消息序列号(用户唯一,有序)
|
||||
@property(nonatomic,assign) uint32_t messageSeq;
|
||||
// 消息时间(服务器时间,单位秒)
|
||||
@property(nonatomic,assign) NSInteger timestamp;
|
||||
|
||||
@property(nonatomic,copy) NSString *cmd;
|
||||
|
||||
@property(nonatomic,copy) NSString *param;
|
||||
|
||||
// 是否为系统cmd消息
|
||||
-(BOOL) same:(WKCMDMessage*)cmdMessage;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@interface WKCMDDB : NSObject
|
||||
|
||||
+ (WKCMDDB *)shared;
|
||||
|
||||
-(uint32_t) getMaxMessageSeq;
|
||||
|
||||
-(void) replaceCMDMessages:(NSArray<WKCMDMessage*>*)messages;
|
||||
|
||||
-(NSArray<WKCMDMessage*>*) queryAllCMDMessages;
|
||||
|
||||
-(void) deleteCMDMessagesWithIDs:(NSArray<NSNumber*>*) ids;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
56
ios/WuKongIMSDK.framework/Headers/WKCMDManager.h
Normal file
56
ios/WuKongIMSDK.framework/Headers/WKCMDManager.h
Normal file
@ -0,0 +1,56 @@
|
||||
//
|
||||
// WKCMDManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/10/7.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKSyncConversationModel.h"
|
||||
@class WKCMDManager;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol WKCMDManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
|
||||
/// 收到命令
|
||||
/// @param manager <#manager description#>
|
||||
/// @param model <#model description#>
|
||||
-(void) cmdManager:(WKCMDManager*)manager onCMD:(WKCMDModel*)model;
|
||||
|
||||
@end
|
||||
|
||||
@interface WKCMDManager : NSObject
|
||||
|
||||
// 设置验证cmd的公钥
|
||||
@property(nonatomic,copy) NSString *pubKey;
|
||||
|
||||
|
||||
/**
|
||||
添加媒体委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void) addDelegate:(id<WKCMDManagerDelegate>) delegate;
|
||||
|
||||
|
||||
/**
|
||||
移除媒体委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void)removeDelegate:(id<WKCMDManagerDelegate>) delegate;
|
||||
|
||||
|
||||
/// 调用接受命令委托
|
||||
/// @param model <#model description#>
|
||||
-(void) callOnCMDDelegate:(WKCMDModel*)model;
|
||||
|
||||
// 拉取cmd消息
|
||||
-(void) pullCMDMessages;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
33
ios/WuKongIMSDK.framework/Headers/WKChannel.h
Normal file
33
ios/WuKongIMSDK.framework/Headers/WKChannel.h
Normal file
@ -0,0 +1,33 @@
|
||||
//
|
||||
// WKChannel.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKChannel : NSObject<NSCopying>
|
||||
// 频道ID
|
||||
@property(nonatomic,copy) NSString *channelId;
|
||||
// 频道类型
|
||||
@property(nonatomic,assign) uint8_t channelType;
|
||||
|
||||
-(instancetype) initWith:(NSString*)channelId channelType:(uint8_t)channelType;
|
||||
|
||||
+(instancetype) channelID:(NSString*)channelId channelType:(uint8_t)channelType;
|
||||
// 群频道
|
||||
+(instancetype) groupWithChannelID:(NSString*)channelID;
|
||||
// 个人频道
|
||||
+(instancetype) personWithChannelID:(NSString*)channelID;
|
||||
|
||||
// 转换为map
|
||||
-(NSDictionary*) toMap;
|
||||
// 从map初始化
|
||||
+(WKChannel*) fromMap:(NSDictionary*)dict;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
147
ios/WuKongIMSDK.framework/Headers/WKChannelInfo.h
Normal file
147
ios/WuKongIMSDK.framework/Headers/WKChannelInfo.h
Normal file
@ -0,0 +1,147 @@
|
||||
//
|
||||
// WKChannelInfo.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/12/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
#import "WKConst.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKChannelInfoFollowStrange = 0, // 未关注
|
||||
WKChannelInfoFollowFriend = 1, // 已关注
|
||||
WKChannelInfoFollowAll = 2,
|
||||
} WKChannelInfoFollow;
|
||||
|
||||
// 扩展字段的key
|
||||
typedef NSString *WKChannelExtraKey NS_STRING_ENUM;
|
||||
|
||||
@interface WKChannelInfo : NSObject<NSCopying>
|
||||
|
||||
// 频道
|
||||
@property(nonatomic,strong) WKChannel *channel;
|
||||
|
||||
// 父类频道
|
||||
@property(nonatomic,strong,nullable) WKChannel *parentChannel;
|
||||
/**
|
||||
是否已关注 0.未关注(陌生人) 1.已关注(好友)
|
||||
*/
|
||||
@property(nonatomic,assign) WKChannelInfoFollow follow;
|
||||
|
||||
@property(nonatomic,assign) BOOL beDeleted; // 是否被对方删除 (好友单向删除)
|
||||
|
||||
@property(nonatomic,assign) BOOL beBlacklist; // 是否被对方拉入黑名单
|
||||
|
||||
/**
|
||||
频道名字
|
||||
*/
|
||||
@property(nonatomic,copy) NSString *name;
|
||||
|
||||
/**
|
||||
频道备注
|
||||
*/
|
||||
@property(nonatomic,copy) NSString *remark;
|
||||
|
||||
|
||||
/// 展示的名字(如果remark为空则显示name,如果remark有值则显示remark)
|
||||
@property(nonatomic,copy) NSString *displayName;
|
||||
|
||||
|
||||
/**
|
||||
频道公告
|
||||
*/
|
||||
@property(nonatomic,copy) NSString *notice;
|
||||
|
||||
|
||||
/**
|
||||
频道logo
|
||||
*/
|
||||
@property(nonatomic,copy) NSString *logo;
|
||||
|
||||
/**
|
||||
是否置顶
|
||||
*/
|
||||
@property(nonatomic,assign) BOOL stick;
|
||||
|
||||
|
||||
/**
|
||||
是否免打扰
|
||||
*/
|
||||
@property(nonatomic,assign) BOOL mute;
|
||||
|
||||
|
||||
/**
|
||||
是否显示昵称
|
||||
*/
|
||||
@property(nonatomic,assign) BOOL showNick;
|
||||
|
||||
|
||||
/**
|
||||
是否保存
|
||||
*/
|
||||
@property(nonatomic,assign) BOOL save;
|
||||
|
||||
|
||||
/// 是否全员禁言
|
||||
@property(nonatomic,assign) BOOL forbidden;
|
||||
|
||||
|
||||
/// 群聊邀请确认
|
||||
@property(nonatomic,assign) BOOL invite;
|
||||
|
||||
/**
|
||||
频道版本号
|
||||
*/
|
||||
@property(nonatomic,assign) long long version;
|
||||
|
||||
|
||||
/// 频道状态 0.正常 2.黑名单
|
||||
@property(nonatomic,assign) NSInteger status;
|
||||
|
||||
|
||||
|
||||
|
||||
/// 是否开启已读回执
|
||||
@property(nonatomic,assign) BOOL receipt;
|
||||
|
||||
/// 是否开启了阅后即焚
|
||||
@property(nonatomic,assign) BOOL flame;
|
||||
@property(nonatomic,assign) NSInteger flameSecond; // 开启阅后即焚的秒数
|
||||
|
||||
/// 是否是机器人
|
||||
@property(nonatomic,assign) BOOL robot;
|
||||
|
||||
|
||||
/// 频道类别
|
||||
@property(nonatomic,copy) NSString *category;
|
||||
|
||||
/// 是否在线
|
||||
@property(nonatomic,assign) BOOL online;
|
||||
// 在线的主设备
|
||||
@property(nonatomic,assign) WKDeviceFlagEnum deviceFlag;
|
||||
/// 最后一次离线时间
|
||||
@property(nonatomic,assign) NSTimeInterval lastOffline;
|
||||
|
||||
|
||||
/**
|
||||
扩展字段
|
||||
*/
|
||||
@property(nonatomic,strong) NSMutableDictionary<WKChannelExtraKey,id> *extra;
|
||||
|
||||
/// 获取扩展字段内的值
|
||||
/// @param key <#key description#>
|
||||
-(id) extraValueForKey:(WKChannelExtraKey)key;
|
||||
|
||||
-(id) extraValueForKey:(WKChannelExtraKey)key defaultValue:(id _Nullable)value;
|
||||
|
||||
-(void) setExtraValue:(id)value forKey:(WKChannelExtraKey)key;
|
||||
|
||||
-(BOOL) settingForKey:(WKChannelExtraKey)key defaultValue:(BOOL)on;
|
||||
|
||||
-(void) setSettingValue:(BOOL)on forKey:(WKChannelExtraKey)key;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
135
ios/WuKongIMSDK.framework/Headers/WKChannelInfoDB.h
Normal file
135
ios/WuKongIMSDK.framework/Headers/WKChannelInfoDB.h
Normal file
@ -0,0 +1,135 @@
|
||||
//
|
||||
// WKChannelInfoDB.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/12/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannelInfo.h"
|
||||
#import "WKDB.h"
|
||||
#import "WKChannelInfoSearchResult.h"
|
||||
#import "WKChannelMessageSearchResult.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// 频道在线状态
|
||||
typedef enum : NSUInteger {
|
||||
WKOnlineStatusOffline, // 离线
|
||||
WKOnlineStatusOnline, // 在线
|
||||
} WKOnlineStatus;
|
||||
|
||||
// 频道状态
|
||||
typedef enum : NSUInteger {
|
||||
WKChannelStatusUnkown,
|
||||
WKChannelStatusNormal,
|
||||
WKChannelStatusBlacklist,
|
||||
} WKChannelStatus;
|
||||
|
||||
@interface WKChannelInfoDB : NSObject
|
||||
+ (WKChannelInfoDB *)shared;
|
||||
|
||||
/**
|
||||
保存频道信息
|
||||
|
||||
@param channelInfo 频道信息
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(BOOL) saveChannelInfo:(WKChannelInfo*)channelInfo;
|
||||
|
||||
|
||||
/**
|
||||
批量修改或添加频道信息
|
||||
|
||||
@param channelInfos <#channelInfos description#>
|
||||
@return 已存在的旧的频道信息集合
|
||||
*/
|
||||
-(NSArray<WKChannelInfo*>*) addOrUpdateChannelInfos:(NSArray<WKChannelInfo*>*)channelInfos;
|
||||
|
||||
/**
|
||||
更新频道信息
|
||||
|
||||
@param channelInfo <#channelInfo description#>
|
||||
*/
|
||||
-(void) updateChannelInfo:(WKChannelInfo*)channelInfo;
|
||||
|
||||
|
||||
|
||||
|
||||
/// 更新在线状态
|
||||
/// @param channel 指定的频道
|
||||
/// @param status 在线状态
|
||||
/// @param lastOffline 最后一次离线时间
|
||||
-(void) updateChannelOnlineStatus:(WKChannel*)channel status:(WKOnlineStatus)status lastOffline:(NSTimeInterval)lastOffline;
|
||||
|
||||
/**
|
||||
更新在线状态
|
||||
@param channel 指定的频道
|
||||
@param status 在线状态
|
||||
@param lastOffline 最后一次离线时间
|
||||
@param mainDeviceFlag 在线的主设备
|
||||
*/
|
||||
-(void) updateChannelOnlineStatus:(WKChannel*)channel status:(WKOnlineStatus)status lastOffline:(NSTimeInterval)lastOffline mainDeviceFlag:(WKDeviceFlagEnum)mainDeviceFlag;
|
||||
|
||||
|
||||
/// 删除频道信息
|
||||
/// @param channel <#channel description#>
|
||||
-(void) deleteChannelInfo:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
获取频道信息
|
||||
|
||||
@param channel 频道
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKChannelInfo*) queryChannelInfo:(WKChannel*)channel;
|
||||
-(WKChannelInfo*) queryChannelInfo:(WKChannel*)channel db:(FMDatabase*)db;
|
||||
|
||||
|
||||
/// 通过状态查询频道信息
|
||||
/// @param status 0.正常 2.黑明单
|
||||
-(NSArray<WKChannelInfo*>*) queryChannelInfosWithStatus:(WKChannelStatus)status;
|
||||
|
||||
|
||||
/// 通过状态和关注类型查询频道集合
|
||||
/// @param status 状态
|
||||
/// @param follow <#follow description#>
|
||||
-(NSArray<WKChannelInfo*>*) queryChannelInfosWithStatusAndFollow:(WKChannelStatus)status follow:(WKChannelInfoFollow)follow;
|
||||
|
||||
|
||||
/// 获取跟我好友关系的频道数据
|
||||
/// @param keyword 关键字
|
||||
/// @param limit 数量限制
|
||||
-(NSArray<WKChannelInfo*>*) queryChannelInfoWithFriend:(NSString*)keyword limit:(NSInteger)limit;
|
||||
|
||||
|
||||
|
||||
/// 查询所有在线的频道
|
||||
-(NSArray<WKChannelInfo*>*) queryChannelOnlines;
|
||||
|
||||
/// 搜索频道信息
|
||||
/// @param keyword 频道关键字
|
||||
/// @param channelType 频道类型
|
||||
/// @param limit 数量限制
|
||||
-(NSArray<WKChannelInfoSearchResult*>*) searchChannelInfoWithKeyword:(NSString*)keyword channelType:(uint8_t)channelType limit:(NSInteger)limit;
|
||||
|
||||
|
||||
/// 搜索频道信息
|
||||
/// @param keyword 频道关键字
|
||||
/// @param limit 数量限制
|
||||
|
||||
-(NSArray<WKChannelMessageSearchResult*>*) searchChannelMessageWithKeyword:(NSString*)keyword limit:(NSInteger)limit;
|
||||
|
||||
/// 查询频道
|
||||
/// @param keyword 关键字
|
||||
/// @param channelType 频道类型
|
||||
/// @param limit 数量限制
|
||||
-(NSArray<WKChannelInfo*>*) queryChannelInfoWithType:(NSString*)keyword channelType:(uint8_t)channelType limit:(NSInteger)limit;
|
||||
|
||||
|
||||
/**
|
||||
查询最近会话的频道
|
||||
*/
|
||||
-(NSArray<WKChannelInfo*>*) queryAllConversationChannelInfos;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,28 @@
|
||||
//
|
||||
// WKChannelInfoSearchResult.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/5/8.
|
||||
//
|
||||
|
||||
/**
|
||||
select t.*,cm.member_name,cm.member_remark from (
|
||||
select channel.*,max(channel_member.id) mid from channel,channel_member where channel.channel_id=channel_member.channel_id and channel.channel_type=channel_member.channel_type and (channel.name like '%Zz%' or channel.remark like '%Zz%' or channel_member.member_name like '%Zz%' or channel_member.member_remark like '%Zz%')
|
||||
group by channel.channel_id,channel.channel_type
|
||||
) t,channel_member cm where t.channel_id=cm.channel_id and t.channel_type=cm.channel_type and t.mid=cm.id
|
||||
*/
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannelInfo.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKChannelInfoSearchResult : NSObject
|
||||
|
||||
// 频道信息
|
||||
@property(nonatomic,strong) WKChannelInfo *channelInfo;
|
||||
|
||||
@property(nonatomic,strong) NSString *containMemberName; // 包含的成员名字,如果有
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
255
ios/WuKongIMSDK.framework/Headers/WKChannelManager.h
Normal file
255
ios/WuKongIMSDK.framework/Headers/WKChannelManager.h
Normal file
@ -0,0 +1,255 @@
|
||||
//
|
||||
// WKChannelManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/12/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
#import "WKChannelInfo.h"
|
||||
#import "WKChannelMemberDB.h"
|
||||
#import "WKTaskOperator.h"
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@protocol WKChannelManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
|
||||
/**
|
||||
频道信息更新
|
||||
|
||||
@param channelInfo <#channelInfo description#>
|
||||
*/
|
||||
-(void) channelInfoUpdate:(WKChannelInfo*)channelInfo;
|
||||
|
||||
-(void) channelInfoUpdate:(WKChannelInfo*)channelInfo oldChannelInfo:(WKChannelInfo* __nullable)oldChannelInfo;
|
||||
|
||||
|
||||
/// 频道数据移除
|
||||
/// @param channel <#channel description#>
|
||||
-(void) channelInfoDelete:(WKChannel*)channel oldChannelInfo:(WKChannelInfo * __nullable )oldChannelInfo;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
typedef void (^WKChannelInfoBlock)(WKChannelInfo*);
|
||||
|
||||
@interface WKChannelManager : NSObject
|
||||
|
||||
+ (WKChannelManager *)shared;
|
||||
|
||||
/**
|
||||
获取频道信息
|
||||
|
||||
@param channel 频道
|
||||
@param channelInfoBlock 获取到频道信息回调
|
||||
*/
|
||||
-(WKTaskOperator*) fetchChannelInfo:(WKChannel*) channel completion:(_Nullable WKChannelInfoBlock)channelInfoBlock;
|
||||
|
||||
-(void) fetchChannelInfo:(WKChannel*) channel;
|
||||
|
||||
/**
|
||||
添加频道请求(此方法时候大量cell获取频道数据)
|
||||
*/
|
||||
-(void) addChannelRequest:(WKChannel*)channel complete:(void(^_Nullable)(NSError *error,bool notifyBefore))complete;
|
||||
|
||||
/**
|
||||
取消请求
|
||||
*/
|
||||
-(void) cancelRequest:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
获取频道信息
|
||||
|
||||
@param channel 频道
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKChannelInfo*) getChannelInfo:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
获取用户频道信息
|
||||
*/
|
||||
-(WKChannelInfo*) getChannelInfoOfUser:(NSString*)uid;
|
||||
|
||||
/**
|
||||
删除频道信息
|
||||
*/
|
||||
-(void) deleteChannelInfo:(WKChannel*) channel;
|
||||
|
||||
|
||||
/**
|
||||
添加或更新频道,如果需要更新的话(只与version大于当前库里的version才更新)
|
||||
|
||||
@param channelInfo <#channelInfo description#>
|
||||
*/
|
||||
-(void) addOrUpdateChannelInfoIfNeed:(WKChannelInfo*) channelInfo;
|
||||
|
||||
|
||||
/**
|
||||
添加或更新(不比较版本)
|
||||
|
||||
@param channelInfo <#channelInfo description#>
|
||||
*/
|
||||
-(void) addOrUpdateChannelInfo:(WKChannelInfo*) channelInfo;
|
||||
|
||||
|
||||
/// 更新频道信息
|
||||
/// @param channelInfo <#channelInfo description#>
|
||||
-(void) updateChannelInfo:(WKChannelInfo*) channelInfo;
|
||||
|
||||
|
||||
/// 添加频道信息
|
||||
/// @param channelInfo <#channelInfo description#>
|
||||
-(void) addChannelInfo:(WKChannelInfo*) channelInfo;
|
||||
/**
|
||||
更新频道设置
|
||||
|
||||
@param channel 频道
|
||||
@param setting 频道设置字典 比例设置免打扰 则传 @{@"mute":@(true)} 设置多个 @{@"mute":@(true),@"stick":@(true)}
|
||||
*/
|
||||
-(void) updateChannelSetting:(WKChannel*)channel setting:(NSDictionary*)setting;
|
||||
|
||||
|
||||
/**
|
||||
批量添加或更新频道信息 (不通知上层)
|
||||
|
||||
@param channelInfos <#channelInfos description#>
|
||||
*/
|
||||
-(void) addOrUpdateChannelInfos:(NSArray<WKChannelInfo*>*) channelInfos;
|
||||
|
||||
|
||||
/**
|
||||
删除某个频道内的成员
|
||||
@param channel 频道
|
||||
*/
|
||||
-(void) deleteMembers:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
添加或更新频道成员
|
||||
|
||||
@param members 频道成员集合
|
||||
*/
|
||||
-(void) addOrUpdateMembers:(NSArray<WKChannelMember*>*)members;
|
||||
|
||||
|
||||
/**
|
||||
获取频道成员集合
|
||||
|
||||
@param channel 频道对象
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(NSArray<WKChannelMember*>*) getMembersWithChannel:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
获取频道成员集合
|
||||
@param channel 频道对象
|
||||
@param limit 数量限制
|
||||
*/
|
||||
-(NSArray<WKChannelMember*>*) getMembersWithChannel:(WKChannel*)channel limit:(NSInteger)limit;
|
||||
|
||||
/**
|
||||
频道成员数量
|
||||
*/
|
||||
-(NSInteger) getMemberCount:(WKChannel*)channel;
|
||||
|
||||
|
||||
/**
|
||||
获取频道指定成员
|
||||
|
||||
@param channel 频道
|
||||
@param uid 成员UID
|
||||
*/
|
||||
-(WKChannelMember*) getMember:(WKChannel*)channel uid:(NSString*)uid;
|
||||
|
||||
|
||||
|
||||
/// 是否是管理员(群主或管理员)
|
||||
/// @param channel <#channel description#>
|
||||
/// @param uid <#uid description#>
|
||||
-(BOOL) isManager:(WKChannel*)channel memberUID:(NSString*)uid;
|
||||
|
||||
/**
|
||||
获取频道的成员最新同步key
|
||||
|
||||
@param channel 频道信息
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(NSString*) getMemberLastSyncKey:(WKChannel*)channel;
|
||||
|
||||
|
||||
/// 设置频道在线
|
||||
/// @param channel <#channel description#>
|
||||
/// @param deviceFlag 设备标记
|
||||
-(void) setChannelOnline:(WKChannel*)channel deviceFlag:(WKDeviceFlagEnum)deviceFlag;
|
||||
-(void) setChannelOnline:(WKChannel*)channel;
|
||||
|
||||
/// 设置频道离线
|
||||
/// @param channel <#channel description#>
|
||||
-(void) setChannelOffline:(WKChannel*)channel;
|
||||
- (void)setChannelOffline:(WKChannel *)channel deviceFlag:(WKDeviceFlagEnum)deviceFlag;
|
||||
|
||||
|
||||
/// 只更新频道的在线状态
|
||||
/// @param online <#online description#>
|
||||
-(void) updateChannelOnlineStatus:(WKChannel*)channel online:(BOOL)online;
|
||||
|
||||
|
||||
|
||||
/// 设置频道离线
|
||||
/// @param channel 频道
|
||||
/// @param lastOffline 最后一次离线时间
|
||||
/// @param deviceFlag 最后一次离线的设备
|
||||
- (void)setChannelOffline:(WKChannel *)channel lastOffline:(NSTimeInterval)lastOffline deviceFlag:(WKDeviceFlagEnum)deviceFlag;
|
||||
-(void) setChannelOffline:(WKChannel*)channel lastOffline:(NSTimeInterval)lastOffline;
|
||||
/**
|
||||
设置频道缓存
|
||||
|
||||
@param channelInfo <#channelInfo description#>
|
||||
*/
|
||||
-(void) setCache:(WKChannelInfo*) channelInfo;
|
||||
|
||||
|
||||
/**
|
||||
获取缓存内的频道信息
|
||||
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKChannelInfo*) getCache:(WKChannel*)channel;
|
||||
|
||||
|
||||
/**
|
||||
从缓存中获取频道成员
|
||||
*/
|
||||
-(WKChannelMember*) getMemberFromCache:(WKChannel *)channel uid:(NSString *)uid;
|
||||
|
||||
|
||||
// 删除频道的成员缓存
|
||||
-(void) deleteMembersWithChannelFromCache:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
移除频道所有缓存
|
||||
*/
|
||||
-(void) removeChannelAllCache;
|
||||
/**
|
||||
添加连接委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void) addDelegate:(id<WKChannelManagerDelegate>) delegate;
|
||||
|
||||
|
||||
/**
|
||||
移除连接委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void)removeDelegate:(id<WKChannelManagerDelegate>) delegate;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
169
ios/WuKongIMSDK.framework/Headers/WKChannelMemberDB.h
Normal file
169
ios/WuKongIMSDK.framework/Headers/WKChannelMemberDB.h
Normal file
@ -0,0 +1,169 @@
|
||||
//
|
||||
// WKChannelMemberDB.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/20.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// 成员角色
|
||||
typedef enum : NSUInteger {
|
||||
WKMemberRoleCommon, // 普通成员
|
||||
WKMemberRoleCreator, // 创建者
|
||||
WKMemberRoleManager, // 管理员
|
||||
} WKMemberRole;
|
||||
|
||||
// 成员状态
|
||||
typedef enum : NSUInteger {
|
||||
WKMemberStatusUnknown,
|
||||
WKMemberStatusNormal, // 正常
|
||||
WKMemberStatusBlacklist, // 被拉入黑名单
|
||||
} WKMemberStatus;
|
||||
|
||||
@interface WKChannelMember : NSObject
|
||||
|
||||
@property(nonatomic,copy) NSString *channelId; // 频道ID
|
||||
@property(nonatomic,assign) uint8_t channelType; // 频道类型
|
||||
@property(nonatomic,copy) NSString *memberAvatar; // 成员头像
|
||||
@property(nonatomic,copy) NSString *memberUid; // 成员uid
|
||||
@property(nonatomic,copy) NSString *memberName; // 成员名称
|
||||
@property(nonatomic,copy) NSString *memberRemark; // 成员备注
|
||||
|
||||
@property(nonatomic,copy,readonly) NSString *displayName;
|
||||
|
||||
@property(nonatomic,assign) WKMemberRole role; // 成员角色
|
||||
@property(nonatomic,assign) WKMemberStatus status; // 成员状态
|
||||
|
||||
@property(nonatomic,strong) NSNumber *version; // 版本
|
||||
@property(nonatomic,strong) NSMutableDictionary *extra; // 扩展字段
|
||||
|
||||
@property(nonatomic,strong) NSString *createdAt; // 成员加入时间
|
||||
@property(nonatomic,strong) NSString *updatedAt; // 成员数据最后一次更新时间
|
||||
|
||||
@property(nonatomic,assign) BOOL robot; // 是否是机器人
|
||||
@property(nonatomic,assign) BOOL isDeleted; // 是否已删除
|
||||
|
||||
@end
|
||||
|
||||
@interface WKChannelMemberDB : NSObject
|
||||
|
||||
+ (WKChannelMemberDB *)shared;
|
||||
|
||||
|
||||
/**
|
||||
添加或更新成员
|
||||
|
||||
@param members <#members description#>
|
||||
*/
|
||||
-(void) addOrUpdateMembers:(NSArray<WKChannelMember*>*)members;
|
||||
|
||||
|
||||
/// 删除频道成员
|
||||
/// @param channel <#channel description#>
|
||||
-(void) deleteMembers:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
获取频道的成员最新同步key
|
||||
|
||||
@param channel 频道信息
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(NSString*) getMemberLastSyncKey:(WKChannel*)channel;
|
||||
|
||||
|
||||
/**
|
||||
获取频道对应的成员列表
|
||||
|
||||
@param channel 频道
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(NSArray<WKChannelMember*>*) getMembersWithChannel:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
获取频道成员集合
|
||||
@param channel 频道对象
|
||||
@param limit 数量限制
|
||||
*/
|
||||
-(NSArray<WKChannelMember*>*) getMembersWithChannel:(WKChannel*)channel limit:(NSInteger)limit;
|
||||
|
||||
/**
|
||||
获取频道成员集合(分页查询)
|
||||
@param channel 频道对象
|
||||
@param keyword 名字关键字筛选 为空则不做为条件筛选
|
||||
@page page 页码 从1开始
|
||||
@param limit 数量限制
|
||||
*/
|
||||
-(NSArray<WKChannelMember*>*) getMembersWithChannel:(WKChannel*)channel keyword:(NSString*)keyword page:(NSInteger)page limit:(NSInteger)limit;
|
||||
-(NSArray<WKChannelMember*>*) getMembersWithChannel:(WKChannel*)channel role:(WKMemberRole)role;
|
||||
|
||||
/// 获取群内的黑名单成员
|
||||
/// @param channel <#channel description#>
|
||||
-(NSArray<WKChannelMember*>*) getBlacklistMembersWithChannel:(WKChannel*)channel;
|
||||
|
||||
|
||||
/// 获取管理员和创建者列表
|
||||
/// @param channel 频道
|
||||
-(NSArray<WKChannelMember*>*) getManagerAndCreator:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
获取频道内指定uid的成员列表
|
||||
|
||||
@param channel <#channel description#>
|
||||
@param uids <#uids description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(NSArray<WKChannelMember*>*) getMembersWithChannel:(WKChannel*)channel uids:(NSArray<NSString*>*)uids;
|
||||
|
||||
|
||||
/**
|
||||
更新指定用户的成员状态
|
||||
@param status 成员状态
|
||||
@param channel 频道
|
||||
@param uids 成员uid集合
|
||||
*/
|
||||
-(void) updateMemberStatus:(WKMemberStatus)status channel:(WKChannel*) channel uids:(NSArray<NSString*>*)uids;
|
||||
|
||||
/**
|
||||
是否是管理员 (群主或管理者)
|
||||
|
||||
@param channel 频道
|
||||
@param uid 用户UID
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(BOOL) isManager:(WKChannel*)channel memberUID:(NSString*)uid;
|
||||
|
||||
|
||||
/**
|
||||
是否是创建者
|
||||
|
||||
@param channel 频道
|
||||
@param uid 用户UID
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(BOOL) isCreator:(WKChannel*)channel memberUID:(NSString*)uid;
|
||||
|
||||
|
||||
/// 成员是否存在频道里
|
||||
/// @param channel 频道对象
|
||||
/// @param uid 成员uid
|
||||
-(BOOL) exist:(WKChannel*)channel uid:(NSString*)uid;
|
||||
|
||||
/**
|
||||
获取指定的成员信息
|
||||
|
||||
@param channel 频道
|
||||
@param uid 成员UID
|
||||
@return 成员信息
|
||||
*/
|
||||
- (WKChannelMember*)get:(WKChannel*)channel memberUID:(NSString *)uid;
|
||||
|
||||
/**
|
||||
获取成员数量
|
||||
*/
|
||||
-(NSInteger) getMemberCount:(WKChannel*)channel;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,26 @@
|
||||
//
|
||||
// WKMessageSearchResult.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/5/10.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannelInfo.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKChannelMessageSearchResult : NSObject
|
||||
|
||||
// 频道信息
|
||||
@property(nonatomic,strong) WKChannel *channel;
|
||||
|
||||
// 消息数量
|
||||
@property(nonatomic,assign) NSInteger messageCount;
|
||||
// 客户端序列号
|
||||
@property(nonatomic,assign) uint32_t orderSeq;
|
||||
// 消息可搜索内容
|
||||
@property(nonatomic,copy) NSString *searchableWord;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
22
ios/WuKongIMSDK.framework/Headers/WKChannelRequestQueue.h
Normal file
22
ios/WuKongIMSDK.framework/Headers/WKChannelRequestQueue.h
Normal file
@ -0,0 +1,22 @@
|
||||
//
|
||||
// WKChannelRequestQueue.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/4/22.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKChannelRequestQueue : NSObject
|
||||
|
||||
+ (WKChannelRequestQueue *)shared;
|
||||
|
||||
|
||||
-(void) addRequest:(WKChannel*)channel complete:(void(^)(NSError *error,bool notifyBefore))complete;
|
||||
|
||||
-(void) cancelRequest:(WKChannel*)channel;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
30
ios/WuKongIMSDK.framework/Headers/WKChatDataProvider.h
Normal file
30
ios/WuKongIMSDK.framework/Headers/WKChatDataProvider.h
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// WKChatDataProvider.h
|
||||
// Pods
|
||||
//
|
||||
// Created by tt on 2022/5/27.
|
||||
//
|
||||
#import "WKSyncChannelMessageModel.h"
|
||||
#ifndef WKChatDataProvider_h
|
||||
#define WKChatDataProvider_h
|
||||
|
||||
|
||||
#endif /* WKChatDataProvider_h */
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
// 同步频道消息
|
||||
typedef void(^WKSyncChannelMessageCallback)(WKSyncChannelMessageModel* __nullable syncChannelMessageModel,NSError * __nullable error);
|
||||
typedef void (^WKSyncChannelMessageProvider)(WKChannel *channel,uint32_t startMessageSeq,uint32_t endMessageSeq,NSInteger limit,WKPullMode pullMode,WKSyncChannelMessageCallback callback);
|
||||
|
||||
// 扩展消息
|
||||
typedef void(^WKSyncMessageExtraCallback)(NSArray<WKMessageExtra*>* __nullable results,NSError * __nullable error);
|
||||
typedef void(^WKSyncMessageExtraProvider)(WKChannel *channel,long long extraVersion,NSInteger limit,WKSyncMessageExtraCallback callback);
|
||||
typedef void(^WKUpdateMessageExtraCallback)(NSError *error);
|
||||
typedef void(^WKUpdateMessageExtraProvider) (WKMessageExtra *newExtra,WKMessageExtra *oldExtra,WKUpdateMessageExtraCallback callback);
|
||||
|
||||
// 消息编辑
|
||||
typedef void(^WKMessageEditCallback)(NSError * __nullable error);
|
||||
typedef void(^WKMessageEditProvider)(WKMessageExtra *extra,WKMessageEditCallback callback);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
393
ios/WuKongIMSDK.framework/Headers/WKChatManager.h
Normal file
393
ios/WuKongIMSDK.framework/Headers/WKChatManager.h
Normal file
@ -0,0 +1,393 @@
|
||||
//
|
||||
// WKChatManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessage.h"
|
||||
#import "WKMessageContent.h"
|
||||
#import "WKSendackPacket.h"
|
||||
#import "WKRecvPacket.h"
|
||||
#import "WKConversation.h"
|
||||
#import "WKMessageStatusModel.h"
|
||||
#import "WKSyncChannelMessageModel.h"
|
||||
#import "WKSetting.h"
|
||||
#import "WKMessageExtra.h"
|
||||
#import "WKChatDataProvider.h"
|
||||
|
||||
@protocol WKChatManagerDelegate;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
typedef BOOL(^MessageStoreBeforeIntercept)(WKMessage*message);
|
||||
|
||||
|
||||
|
||||
@interface WKChatManager : NSObject
|
||||
|
||||
|
||||
/**
|
||||
发送消息 (发送并保存消息)
|
||||
|
||||
@param content 消息正文
|
||||
@param channel 投递到那个频道
|
||||
*/
|
||||
-(WKMessage*) sendMessage:(WKMessageContent*)content channel:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
发送消息 (发送并保存消息)
|
||||
@param content 消息正文
|
||||
@param channel 投递到那个频道
|
||||
@param topic 话题
|
||||
*/
|
||||
-(WKMessage*) sendMessage:(WKMessageContent*)content channel:(WKChannel*)channel topic:(NSString*)topic;
|
||||
|
||||
/**
|
||||
发送消息 (发送并保存消息)
|
||||
|
||||
@param content 消息正文
|
||||
@param channel 投递到那个频道
|
||||
@param setting 消息设置
|
||||
*/
|
||||
-(WKMessage*) sendMessage:(WKMessageContent*)content channel:(WKChannel*)channel setting:(WKSetting * __nullable)setting;
|
||||
|
||||
-(WKMessage*) sendMessage:(WKMessageContent*)content channel:(WKChannel*)channel setting:(WKSetting * __nullable)setting topic:(NSString*)topic;
|
||||
|
||||
/**
|
||||
发送消息(仅仅发送,不保存)
|
||||
|
||||
@param message 消息
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKMessage*) sendMessage:(WKMessage*)message;
|
||||
|
||||
/// 发送消息
|
||||
/// @param message 消息对象
|
||||
/// @param addRetryQueue 是否添加到重试队列,如果是true,消息发送失败将会进行指定次数的重试
|
||||
-(WKMessage*) sendMessage:(WKMessage*)message addRetryQueue:(BOOL)addRetryQueue;
|
||||
|
||||
|
||||
/**
|
||||
消息重发
|
||||
@param message 重发的消息
|
||||
*/
|
||||
-(WKMessage*) resendMessage:(WKMessage*)message;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
保存消息 (都为自己所发消息)
|
||||
|
||||
@param content 消息正文
|
||||
@param channel 频道
|
||||
*/
|
||||
-(WKMessage*) saveMessage:(WKMessageContent*)content channel:(WKChannel*)channel;
|
||||
|
||||
|
||||
/**
|
||||
保存消息(可自定发送者)
|
||||
|
||||
@param content 消息正文
|
||||
@param channel 频道
|
||||
@param fromUid 发送者uid
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKMessage*) saveMessage:(WKMessageContent*)content channel:(WKChannel*)channel fromUid:( NSString* __nullable)fromUid;
|
||||
|
||||
-(WKMessage*) saveMessage:(WKMessageContent*)content channel:(WKChannel*)channel fromUid:(NSString* __nullable)fromUid status:(WKMessageStatus)status;
|
||||
|
||||
|
||||
/// 保存消息
|
||||
-(void) saveMessages:(NSArray<WKMessage*>*)messages;
|
||||
|
||||
/**
|
||||
转发消息
|
||||
|
||||
@param content 消息正文
|
||||
@param channel 频道
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKMessage*) forwardMessage:(WKMessageContent*)content channel:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
编辑消息
|
||||
@param message 需要编辑的消息
|
||||
@param newContent 编辑后的正文
|
||||
*/
|
||||
-(WKMessage*) editMessage:(WKMessage*)message newContent:(WKMessageContent*)newContent;
|
||||
|
||||
/**
|
||||
删除消息
|
||||
|
||||
@param message 消息对象
|
||||
*/
|
||||
-(void) deleteMessage:(WKMessage*)message;
|
||||
|
||||
/**
|
||||
删除指定频道指定发送者的消息
|
||||
*/
|
||||
-(void) deleteMessage:(NSString*)fromUID channel:(WKChannel*)channel;
|
||||
|
||||
|
||||
/**
|
||||
清除指定频道的消息
|
||||
|
||||
@param channel 频道
|
||||
*/
|
||||
-(void) clearMessages:(WKChannel*)channel;
|
||||
|
||||
|
||||
/// 清除当前用户的所有消息
|
||||
-(void) clearAllMessages;
|
||||
|
||||
/**
|
||||
清除指定maxMsgSeq以前的所有消息
|
||||
@param channel 频道
|
||||
@param maxMsgSeq 指定的messageSeq
|
||||
@param isContain 清除的消息是否包含指定的maxMsgSeq
|
||||
*/
|
||||
- (void) clearFromMsgSeq:(WKChannel*)channel maxMsgSeq:(uint32_t)maxMsgSeq isContain:(BOOL)isContain;
|
||||
|
||||
/**
|
||||
查询某个频道最新的消息 (一般是第一次进入会话页面查询首屏消息时调用此方法)
|
||||
@param channel 频道
|
||||
@param limit 消息数量限制
|
||||
@param complete 查询回调
|
||||
*/
|
||||
-(void) pullLastMessages:(WKChannel*)channel limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
|
||||
|
||||
/**
|
||||
查询某个频道最新的消息 (一般是第一次进入会话页面查询首屏消息时调用此方法)
|
||||
@param channel 频道
|
||||
@param limit 消息数量限制
|
||||
@param complete 查询回调
|
||||
@param alwayRequest 是否总是从服务器请求最新的消息数据
|
||||
*/
|
||||
-(void) pullLastMessages:(WKChannel*)channel limit:(int)limit alwayRequest:(BOOL)alwayRequest complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
|
||||
|
||||
/**
|
||||
下拉加载消息
|
||||
@param channel 频道
|
||||
@param startOrderSeq 起始的orderSeq 比如需要查询 100以上的10条消息 那么startOrderSeq就是100 查询出来的数据为 90 91 92 93 94 95 96 97 98 99
|
||||
@param limit 消息数量限制
|
||||
@param complete 查询回调
|
||||
*/
|
||||
-(void) pullDown:(WKChannel*)channel startOrderSeq:(uint32_t)startOrderSeq limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
|
||||
|
||||
/**
|
||||
上拉加载消息
|
||||
@param startOrderSeq 起始的orderSeq 比如需要查询 100以下的10条消息 那么startOrderSeq就是100 查询出来的数据为 101 102 103 104 105 106 107 108 109 110
|
||||
@param limit 消息数量限制
|
||||
@param complete 查询回调
|
||||
*/
|
||||
-(void) pullUp:(WKChannel*)channel startOrderSeq:(uint32_t)startOrderSeq limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
|
||||
|
||||
/**
|
||||
查询指定orderSeq周围的消息 上5条下5条 ,比如 orderSeq 为 20 则查询 16 17 18 19 20 21 22 23 24 25 主要使用在定位消息
|
||||
@param channel 频道
|
||||
@param orderSeq 以此OrderSeq查询周围的消息
|
||||
*/
|
||||
-(void) pullAround:(WKChannel*)channel orderSeq:(uint32_t)orderSeq limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
拉取历史消息
|
||||
@param channel 频道
|
||||
@param startOrderSeq 基准messageSeq 以此messageSeq为基准进行上下浮动查询
|
||||
@param endOrderSeq 结束的messageSeq 查询到此messageSeq为终止 如果为 0 则不做限制 limit限制查询数量
|
||||
@param limit 消息数量限制
|
||||
@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");
|
||||
|
||||
/**
|
||||
查询消息
|
||||
@param channel 频道
|
||||
@param aroundOrderSeq 以此OrderSeq查询周围的消息
|
||||
*/
|
||||
-(void) getMessages:(WKChannel*)channel aroundOrderSeq:(uint32_t)aroundOrderSeq limit:(int)limit complete:(void(^)(NSArray<WKMessage*> *messages,NSError *error))complete DEPRECATED_MSG_ATTRIBUTE("use pullAround");;
|
||||
|
||||
|
||||
/**
|
||||
更新语音消息已读状态
|
||||
|
||||
@param message 消息
|
||||
*/
|
||||
-(void) updateMessageVoiceReaded:(WKMessage*)message;
|
||||
|
||||
/**
|
||||
更新本地扩展数据
|
||||
|
||||
@param message 消息对象
|
||||
*/
|
||||
-(void) updateMessageLocalExtra:(WKMessage*)message;
|
||||
|
||||
/**
|
||||
更新消息远程扩展
|
||||
*/
|
||||
-(void) updateMessageRemoteExtra:(WKMessage*)message;
|
||||
|
||||
|
||||
/// 撤回消息
|
||||
/// @param message <#message description#>
|
||||
-(void) revokeMessage:(WKMessage*)message;
|
||||
|
||||
|
||||
|
||||
/// 获取orderSeq
|
||||
/// @param messageSeq <#messageSeq description#>
|
||||
-(uint32_t) getOrderSeq:(uint32_t)messageSeq;
|
||||
|
||||
-(uint32_t) getMessageSeq:(uint32_t) orderSeq;
|
||||
|
||||
/**
|
||||
获取最接近orderSeq的有效orderSeq
|
||||
*/
|
||||
-(uint32_t) getOrNearbyMessageSeq:(uint32_t)orderSeq;
|
||||
|
||||
|
||||
/// 正文包装为消息
|
||||
/// @param content 消息正文
|
||||
/// @param channel 频道
|
||||
/// @param fromUid 发送者UID
|
||||
-(WKMessage*) contentToMessage:(WKMessageContent*)content channel:(WKChannel*)channel fromUid:(NSString * __nullable)fromUid;
|
||||
|
||||
|
||||
|
||||
/// 通过正文类型获取content
|
||||
/// @param contentType 正文类型
|
||||
-(WKMessageContent*) getMessageContent:(NSInteger)contentType;
|
||||
|
||||
/**
|
||||
添加委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void) addDelegate:(id<WKChatManagerDelegate>) delegate;
|
||||
|
||||
|
||||
/**
|
||||
移除委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void)removeDelegate:(id<WKChatManagerDelegate>) delegate;
|
||||
|
||||
|
||||
|
||||
/// 添加消息存储之拦截器
|
||||
/// @param sid 拦截器唯一ID
|
||||
/// @param intercept 拦截器 返回true表示消息存储 返回false表示消息不存储
|
||||
-(void) addMessageStoreBeforeIntercept:(NSString*)sid intercept:(MessageStoreBeforeIntercept)intercept;
|
||||
|
||||
|
||||
/// 移除消息存储之前的拦截器
|
||||
/// @param sid 拦截器唯一ID
|
||||
-(void) removeMessageStoreBeforeIntercept:(NSString*)sid;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// 调用拦截器获得消息是否需要存储
|
||||
/// @param message <#message description#>
|
||||
-(BOOL) needStoreOfIntercept:(WKMessage*)message;
|
||||
|
||||
/**
|
||||
同步消息的扩展数据
|
||||
*/
|
||||
-(void) syncMessageExtra:(WKChannel*)channel complete:(void(^_Nullable)(NSError * _Nullable error))complete;
|
||||
|
||||
/**
|
||||
标记消息为已读
|
||||
*/
|
||||
//-(void) markReaded:(WKChannel*)channel messages:(NSArray<WKMessage*>*)messages;
|
||||
|
||||
|
||||
// 获取某个频道内最新的消息
|
||||
-(WKMessage*) getLastMessage:(WKChannel*)channel;
|
||||
|
||||
// 通知UI消息更新
|
||||
- (void)callMessageUpdateDelegate:(WKMessage*)message;
|
||||
|
||||
// 通知UI收到消息
|
||||
- (void)callRecvMessagesDelegate:(NSArray<WKMessage*>*)messages;
|
||||
|
||||
/// 同步频道消息提供者(由第三方设置)
|
||||
@property(nonatomic,copy) WKSyncChannelMessageProvider syncChannelMessageProvider;
|
||||
|
||||
@property(nonatomic,copy) WKSyncMessageExtraProvider syncMessageExtraProvider; // 同步消息扩展
|
||||
@property(nonatomic,copy) WKUpdateMessageExtraProvider updateMessageExtraProvider; // 更新消息扩展
|
||||
|
||||
// 消息编辑提供者
|
||||
@property(nonatomic,copy) WKMessageEditProvider messageEditProvider;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
聊天管理委托
|
||||
*/
|
||||
@protocol WKChatManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
收到消息回调
|
||||
|
||||
@param message 收到的消息
|
||||
@param left 消息剩余数量 ,可当left为0时再刷新UI
|
||||
*/
|
||||
- (void)onRecvMessages:(WKMessage*)message left:(NSInteger)left;
|
||||
|
||||
/**
|
||||
消息更新
|
||||
|
||||
@param message <#message description#>
|
||||
@param left 消息剩余数量 ,可当left为0时再刷新UI
|
||||
*/
|
||||
-(void) onMessageUpdate:(WKMessage*) message left:(NSInteger)left;
|
||||
|
||||
/**
|
||||
消息更新
|
||||
|
||||
@param message <#message description#>
|
||||
@param left 消息剩余数量 ,可当left为0时再刷新UI
|
||||
@param total 消息总数量
|
||||
*/
|
||||
-(void) onMessageUpdate:(WKMessage*) message left:(NSInteger)left total:(NSInteger)total;
|
||||
|
||||
/**
|
||||
发送消息回执回调
|
||||
*/
|
||||
-(void) onSendack:(WKSendackPacket*) sendackPacket left:(NSInteger)left;
|
||||
|
||||
|
||||
/**
|
||||
消息被删除
|
||||
|
||||
@param message 被删除的消息
|
||||
*/
|
||||
-(void) onMessageDeleted:(WKMessage*) message;
|
||||
|
||||
|
||||
/**
|
||||
指定频道的消息已清除
|
||||
|
||||
@param channel <#channel description#>
|
||||
*/
|
||||
-(void) onMessageCleared:(WKChannel*)channel;
|
||||
|
||||
|
||||
/// 清除所有消息
|
||||
-(void) onMessageAllCleared;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
59
ios/WuKongIMSDK.framework/Headers/WKChatManagerInner.h
Normal file
59
ios/WuKongIMSDK.framework/Headers/WKChatManagerInner.h
Normal file
@ -0,0 +1,59 @@
|
||||
//
|
||||
// WKChatManagerInner.h
|
||||
// Pods
|
||||
//
|
||||
// Created by tt on 2022/5/27.
|
||||
//
|
||||
|
||||
#ifndef WKChatManagerInner_h
|
||||
#define WKChatManagerInner_h
|
||||
|
||||
|
||||
#endif /* WKChatManagerInner_h */
|
||||
|
||||
|
||||
@interface WKChatManager ()
|
||||
|
||||
|
||||
/**
|
||||
处理发送消息回执
|
||||
|
||||
@param sendackArray <#sendackArray description#>
|
||||
*/
|
||||
-(void) handleSendack:(NSArray<WKSendackPacket*> *)sendackArray;
|
||||
|
||||
|
||||
/**
|
||||
处理收到消息
|
||||
|
||||
@param packets <#packets description#>
|
||||
*/
|
||||
-(void) handleRecv:(NSArray<WKRecvPacket*>*) packets;
|
||||
|
||||
|
||||
/**
|
||||
处理消息 (流程: 保存消息-> 触发收到消息委托 -> 保存或更新最近会话 -> 触发最近会话委托)
|
||||
|
||||
@param messages <#messages description#>
|
||||
*/
|
||||
-(void) handleMessages:(NSArray<WKMessage*>*) messages;
|
||||
|
||||
|
||||
// 调用消息状态改变委托
|
||||
//- (void)callMessageStatusChangeDelegate:(NSArray<WKMessageStatusModel*>*)statusModels;
|
||||
|
||||
// 调用消息更新委托
|
||||
- (void)callMessageUpdateDelegate:(WKMessage*)message left:(NSInteger)left total:(NSInteger)total;
|
||||
|
||||
|
||||
|
||||
/// 调用收到消息的委托
|
||||
/// @param messages <#messages description#>
|
||||
- (void)callRecvMessagesDelegate:(NSArray<WKMessage*>*)messages;
|
||||
|
||||
/// 获取所有消息存储之前的拦截器
|
||||
-(NSArray<MessageStoreBeforeIntercept>*) getMessageStoreBeforeIntercepts;
|
||||
|
||||
|
||||
|
||||
@end
|
35
ios/WuKongIMSDK.framework/Headers/WKCoder.h
Normal file
35
ios/WuKongIMSDK.framework/Headers/WKCoder.h
Normal file
@ -0,0 +1,35 @@
|
||||
//
|
||||
// WKCoder.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/25.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
@interface WKCoder : NSObject
|
||||
|
||||
|
||||
/**
|
||||
编码包
|
||||
|
||||
@param packet 包对象
|
||||
@return 返回包的二进制数据
|
||||
*/
|
||||
-(NSData*) encode:(WKPacket*)packet;
|
||||
|
||||
|
||||
/**
|
||||
解码包
|
||||
|
||||
@param data <#data description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKPacket*) decode:(NSData*)data;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
27
ios/WuKongIMSDK.framework/Headers/WKConnackPacket.h
Normal file
27
ios/WuKongIMSDK.framework/Headers/WKConnackPacket.h
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// WKConnackPacket.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/26.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
#import "WKPacketBodyCoder.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKConnackPacket : WKPacket<WKPacketBodyCoder>
|
||||
|
||||
// 通过客户端的RSA公钥加密的服务端DH公钥
|
||||
@property(nonatomic,copy) NSString *serverKey;
|
||||
// 安全吗
|
||||
@property(nonatomic,copy) NSString *salt;
|
||||
// 客户端与服务器的时间差值
|
||||
@property(nonatomic,assign) int64_t timeDiff;
|
||||
|
||||
// 连接返回原因代号
|
||||
@property(nonatomic,assign) uint8_t reasonCode;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
23
ios/WuKongIMSDK.framework/Headers/WKConnectInfo.h
Normal file
23
ios/WuKongIMSDK.framework/Headers/WKConnectInfo.h
Normal file
@ -0,0 +1,23 @@
|
||||
//
|
||||
// WKConnectInfo.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/2/7.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKConnectInfo : NSObject
|
||||
|
||||
@property(nonatomic,copy) NSString *uid;
|
||||
@property(nonatomic,copy) NSString *token;
|
||||
@property(nonatomic,copy) NSString *name;
|
||||
@property(nonatomic,copy) NSString *avatar;
|
||||
|
||||
+(instancetype) initWithUID:(NSString*)uid token:(NSString*)token name:(NSString*)name avatar:(NSString*)avatar;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
32
ios/WuKongIMSDK.framework/Headers/WKConnectPacket.h
Normal file
32
ios/WuKongIMSDK.framework/Headers/WKConnectPacket.h
Normal file
@ -0,0 +1,32 @@
|
||||
//
|
||||
// WKConnectPacket.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/25.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
#import "WKPacketBodyCoder.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKConnectPacket : WKPacket<WKPacketBodyCoder>
|
||||
|
||||
// 协议版本号
|
||||
@property(nonatomic,assign) uint8_t version;
|
||||
// 客户端KEY (base64编码的DH公钥)
|
||||
@property(nonatomic,copy) NSString *clientKey;
|
||||
// 用户的唯一uid
|
||||
@property(nonatomic,copy) NSString *uid;
|
||||
// 连接凭证token
|
||||
@property(nonatomic,copy) NSString *token;
|
||||
// 设备标示 0.app 1.pc
|
||||
@property(nonatomic,assign) uint8_t deviceFlag;
|
||||
// 设备ID
|
||||
@property(nonatomic,copy) NSString *deviceId;
|
||||
// 客户端当前时间戳(13位时间戳,到毫秒)
|
||||
@property(nonatomic,assign) uint64_t clientTimestamp;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
110
ios/WuKongIMSDK.framework/Headers/WKConnectionManager.h
Normal file
110
ios/WuKongIMSDK.framework/Headers/WKConnectionManager.h
Normal file
@ -0,0 +1,110 @@
|
||||
//
|
||||
// WKConnectionManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
#import "WKConnectInfo.h"
|
||||
#import "WKConst.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKNoConnect, // 未连接
|
||||
WKConnecting, // 连接中
|
||||
WKPullingOffline, // 拉取离线中
|
||||
WKConnected, // 已建立连接
|
||||
WKDisconnected, // 断开连接
|
||||
} WKConnectStatus;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@protocol WKConnectionManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
/**
|
||||
连接状态监听
|
||||
*/
|
||||
-(void) onConnectStatus:(WKConnectStatus)status reasonCode:(WKReason)reasonCode;
|
||||
|
||||
|
||||
/**
|
||||
连接被踢出
|
||||
|
||||
@param reasonCode 踢出原因代号
|
||||
@param reason 踢出原因字符串
|
||||
*/
|
||||
-(void) onKick:(uint8_t)reasonCode reason:(NSString*)reason;
|
||||
@end
|
||||
|
||||
@interface WKConnectionManager : NSObject
|
||||
|
||||
+ (WKConnectionManager*)sharedManager;
|
||||
|
||||
@property(nonatomic,assign,readonly) WKConnectStatus connectStatus;
|
||||
|
||||
|
||||
/// 获取连接地址
|
||||
@property(nonatomic,copy) void(^getConnectAddr)(void(^complete)(NSString * __nullable addr));
|
||||
/**
|
||||
* 连接悟空IM服务器
|
||||
*/
|
||||
-(void) connect;
|
||||
|
||||
/**
|
||||
断开连接
|
||||
@param force 是否强制断开 如果force设置为true 将不再自动重连
|
||||
*/
|
||||
-(void) disconnect:(BOOL) force;
|
||||
|
||||
|
||||
/// 登出,将强制断开,并清除登录信息
|
||||
-(void) logout;
|
||||
|
||||
|
||||
/**
|
||||
添加连接委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void) addDelegate:(id<WKConnectionManagerDelegate>) delegate;
|
||||
|
||||
|
||||
/**
|
||||
移除连接委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void)removeDelegate:(id<WKConnectionManagerDelegate>) delegate;
|
||||
|
||||
|
||||
/**
|
||||
发送包
|
||||
|
||||
@param packet <#packet description#>
|
||||
*/
|
||||
-(void) sendPacket:(WKPacket*)packet;
|
||||
|
||||
|
||||
/**
|
||||
发送ping包
|
||||
*/
|
||||
-(void) sendPing;
|
||||
|
||||
/**
|
||||
唤醒IM
|
||||
@param timeout 超时时间(超时后不管有没有成功都会执行complete)
|
||||
*/
|
||||
-(void) wakeup:(NSTimeInterval)timeout complete:(void(^__nullable)(NSError * __nullable error))complete;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
93
ios/WuKongIMSDK.framework/Headers/WKConst.h
Normal file
93
ios/WuKongIMSDK.framework/Headers/WKConst.h
Normal file
@ -0,0 +1,93 @@
|
||||
//
|
||||
// WKConst.h
|
||||
// Pods
|
||||
//
|
||||
// Created by tt on 2019/11/25.
|
||||
//
|
||||
|
||||
|
||||
|
||||
// 正文类型
|
||||
typedef enum : NSUInteger {
|
||||
WK_TEXT = 1, // 文本消息
|
||||
WK_IMAGE = 2, // 图片消息
|
||||
WK_GIF = 3, // gif表情
|
||||
WK_VOICE = 4, // 语音消息
|
||||
|
||||
WK_SIGNAL_ERROR = 98, // signal解密失败
|
||||
WK_CMD = 99, // 命令消息
|
||||
WK_UNKNOWN = 0, // 未知消息
|
||||
} WKContentType;
|
||||
|
||||
|
||||
|
||||
// 消息状态
|
||||
typedef enum : NSUInteger {
|
||||
WK_MESSAGE_WAITSEND, // 等待发送
|
||||
WK_MESSAGE_SUCCESS, // 发送成功
|
||||
WK_MESSAGE_ONLYSAVE, // 仅仅保存消息(不做重发处理)
|
||||
WK_MESSAGE_UPLOADING, // 上传中
|
||||
WK_MESSAGE_FAIL, // 发送失败
|
||||
} WKMessageStatus;
|
||||
|
||||
|
||||
typedef enum : uint8_t {
|
||||
NONE,
|
||||
WK_CONNECT = 1, // 客户端请求连接到服务器(c2s)
|
||||
WK_CONNACK =2, // 服务端收到连接请求后确认的报文(s2c)
|
||||
WK_SEND = 3, // 发送消息(c2s)
|
||||
WK_SENDACK = 4, // 收到消息确认的报文(s2c)
|
||||
WK_RECV = 5, //收取消息(s2c)
|
||||
WK_RECVACK = 6, // 收取消息确认(c2s)
|
||||
WK_PING = 7, //ping请求
|
||||
WK_PONG = 8, // 对ping请求的相应
|
||||
WK_DISCONNECT = 9 // 断开连接
|
||||
} WKPacketType;
|
||||
|
||||
|
||||
typedef enum : uint8_t {
|
||||
WK_REASON_UNKNOWN = 0, // 未知
|
||||
WK_REASON_SUCCESS = 1, // 认证成功
|
||||
WK_REASON_AUTHFAIL = 2, // 认证失败(一般是token不正确)
|
||||
WK_REASON_IN_BLACKLIST = 4, // 在黑名单内
|
||||
WK_REASON_KICK = 12, // 被踢
|
||||
WK_REASON_NOT_IN_WHITELIST = 13, // 没在好友白明单内(说明不是好友)
|
||||
|
||||
} WKReason;
|
||||
|
||||
// 频道类型
|
||||
typedef enum : uint8_t {
|
||||
WK_PERSON = 1, // 个人
|
||||
WK_GROUP = 2, // 群组
|
||||
WK_COMMUNITY = 4, // 社区
|
||||
WK_COMMUNITY_TOPIC = 5, // 社区话题
|
||||
WK_COMMUNITY_INFO = 6, // 信息频道
|
||||
} WKChannelType;
|
||||
|
||||
// 协议类型
|
||||
typedef enum : NSUInteger {
|
||||
WK_PROTO_WKAO,
|
||||
WK_PROTO_MOS
|
||||
} WKProto;
|
||||
|
||||
|
||||
// 设备类型
|
||||
typedef enum : NSInteger {
|
||||
WKDeviceFlagEnumUnknown = -1, // 未知
|
||||
WKDeviceFlagEnumAPP = 0, // APP
|
||||
WKDeviceFlagEnumWeb = 1, // Web
|
||||
WKDeviceFlagEnumPC = 2 // PC
|
||||
} WKDeviceFlagEnum;
|
||||
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKPullModeDown,
|
||||
WKPullModeUp,
|
||||
} WKPullMode;
|
||||
|
||||
|
||||
// cmd sign签名错误
|
||||
#define WKCMDSignError @"cmdSignError"
|
||||
|
||||
// 排序序号因子
|
||||
#define WKOrderSeqFactor 1000
|
90
ios/WuKongIMSDK.framework/Headers/WKConversation.h
Normal file
90
ios/WuKongIMSDK.framework/Headers/WKConversation.h
Normal file
@ -0,0 +1,90 @@
|
||||
//
|
||||
// WKConversation.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/12/8.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
#import "WKChannelInfo.h"
|
||||
#import "WKMessage.h"
|
||||
#import "WKReminderManager.h"
|
||||
#import "WKConversationExtra.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
|
||||
@interface WKConversation : NSObject<NSCopying>
|
||||
|
||||
@property(nonatomic,strong) WKChannel *channel; // 频道
|
||||
|
||||
@property(nonatomic,strong,nullable) WKChannel *parentChannel; // 父类频道
|
||||
/**
|
||||
* 频道资料,可能为空,如果为空可以调用WKChannelManager fetchChannelInfo:completion 触发频道信息变更委托
|
||||
*/
|
||||
@property(nullable,nonatomic,strong,readonly) WKChannelInfo *channelInfo;
|
||||
/**
|
||||
头像
|
||||
*/
|
||||
@property(nonatomic,copy) NSString *avatar;
|
||||
/**
|
||||
最新一条消息的客户端seq
|
||||
*/
|
||||
//@property(nonatomic,assign) uint32_t lastClientSeq;
|
||||
/// 最后一条消息的客户端编号
|
||||
@property(nonatomic,copy) NSString *lastClientMsgNo;
|
||||
|
||||
// 最后一条消息的额messageSeq
|
||||
@property(nonatomic,assign) uint32_t lastMessageSeq;
|
||||
|
||||
/**
|
||||
最后一条消息 (如果内存没有则去数据库查询)
|
||||
*/
|
||||
@property(nonatomic,strong) WKMessage *lastMessage;
|
||||
|
||||
/**
|
||||
最后一条消息(如果没有不进行数据库加载)
|
||||
*/
|
||||
@property(nonatomic,strong) WKMessage *lastMessageInner;
|
||||
|
||||
/**
|
||||
最新一条消息时间 (10位时间戳到秒)
|
||||
*/
|
||||
@property(nonatomic,assign) NSInteger lastMsgTimestamp;
|
||||
|
||||
|
||||
//@property(nonatomic,assign) uint32_t browseTo;
|
||||
/**
|
||||
未读消息数量
|
||||
*/
|
||||
@property(nonatomic,assign) NSInteger unreadCount;
|
||||
|
||||
|
||||
/**
|
||||
提醒项
|
||||
*/
|
||||
@property(nonatomic,strong) NSArray<WKReminder*> *reminders;
|
||||
@property(nonatomic,strong,readonly) NSArray<WKReminder*> *simpleReminders; // 除去重复的type了的reminder
|
||||
|
||||
/**
|
||||
扩展数据
|
||||
*/
|
||||
@property(nonatomic,strong) NSDictionary *extra;
|
||||
/// 数据版本
|
||||
@property(nonatomic,assign) long long version;
|
||||
// 是否已删除
|
||||
@property(nonatomic,assign) NSInteger isDeleted;
|
||||
// 免打扰
|
||||
@property(nonatomic,assign) BOOL mute;
|
||||
// 置顶
|
||||
@property(nonatomic,assign) BOOL stick;
|
||||
|
||||
/// 重新加载最后一条消息(重新从数据库里获取)
|
||||
-(void) reloadLastMessage;
|
||||
// 服务端扩展数据
|
||||
@property(nonatomic,strong) WKConversationExtra *remoteExtra;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
211
ios/WuKongIMSDK.framework/Headers/WKConversationDB.h
Normal file
211
ios/WuKongIMSDK.framework/Headers/WKConversationDB.h
Normal file
@ -0,0 +1,211 @@
|
||||
//
|
||||
// WKConversationDB.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/29.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKConversation.h"
|
||||
#import "WKDB.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@class WKConversationAddOrUpdateResult;
|
||||
@interface WKConversationDB : NSObject
|
||||
|
||||
+ (WKConversationDB *)shared;
|
||||
|
||||
|
||||
/**
|
||||
添加或修改最近会话
|
||||
|
||||
@param conversation <#conversation description#>
|
||||
*/
|
||||
-(void) addOrUpdateConversation:(WKConversation*)conversation;
|
||||
|
||||
|
||||
/// 取代最近会话
|
||||
/// @param conversations <#conversation description#>
|
||||
-(void) replaceConversations:(NSArray<WKConversation*>*)conversations;
|
||||
|
||||
|
||||
/// 添加最近会话信息
|
||||
/// @param conversation <#conversation description#>
|
||||
-(void) addConversation:(WKConversation*)conversation;
|
||||
|
||||
|
||||
/// 恢复指定会话
|
||||
/// @param channel <#channel description#>
|
||||
/// @return 如果存在会话的会话则返回,不存在则返回nil
|
||||
-(WKConversation*) recoveryConversation:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
查询指定频道的最近会话
|
||||
|
||||
@param channel <#channel description#>
|
||||
@param db <#db description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKConversation*) getConversationWithChannel:(WKChannel*)channel db:(FMDatabase*)db;
|
||||
|
||||
/// 查询指定频道的最近会话(包含is_deleted=1的频道)
|
||||
/// @param channel 指定频道
|
||||
/// @param db <#db description#>
|
||||
-(WKConversation*) getConversationWithChannelInAll:(WKChannel*)channel db:(FMDatabase*)db;
|
||||
|
||||
/**
|
||||
查询频道类的最近会话数据
|
||||
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(NSArray<WKConversation*>*) getConversationList;
|
||||
|
||||
|
||||
/**
|
||||
获取最近会话
|
||||
|
||||
@param channel 频道
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKConversation*) getConversation:(WKChannel*)channel;
|
||||
|
||||
// 通过频道集合获取最近会话集合
|
||||
-(NSArray<WKConversation*>*) getConversations:(NSArray<WKChannel*> *)channels;
|
||||
|
||||
|
||||
/**
|
||||
通过最后一条消息的客户端序号获取最近会话
|
||||
|
||||
@param lastClientMsgNo 最后一条消息的编号
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKConversation*) getConversationWithLastClientMsgNo:(NSString*)lastClientMsgNo;
|
||||
|
||||
|
||||
|
||||
/// 获取会话最大数据版本号
|
||||
-(long long) getConversationMaxVersion;
|
||||
|
||||
|
||||
/// 获取同步key
|
||||
-(NSString*) getConversationSyncKey;
|
||||
/**
|
||||
更新最近会话
|
||||
|
||||
@param conversation <#conversation description#>
|
||||
*/
|
||||
-(void) updateConversation:(WKConversation*)conversation;
|
||||
/**
|
||||
更新最近会话
|
||||
|
||||
@param conversation <#conversation description#>
|
||||
@param db <#db description#>
|
||||
*/
|
||||
-(void) updateConversation:(WKConversation*)conversation db:(FMDatabase*)db;
|
||||
|
||||
|
||||
/**
|
||||
插入最近会话
|
||||
|
||||
@param conversation <#conversation description#>
|
||||
@param db <#db description#>
|
||||
*/
|
||||
-(void) insertConversation:(WKConversation*)conversation db:(FMDatabase*)db;
|
||||
|
||||
|
||||
/**
|
||||
清除指定频道的未读消息
|
||||
|
||||
@param channel <#channel description#>
|
||||
*/
|
||||
-(void) clearConversationUnreadCount:(WKChannel*)channel;
|
||||
|
||||
|
||||
|
||||
/// 设置最近会话未读数
|
||||
/// @param channel 频道
|
||||
/// @param unread 未读数量
|
||||
-(void) setConversationUnreadCount:(WKChannel*)channel unread:(NSInteger)unread;
|
||||
|
||||
|
||||
/// 删除指定频道的最近会话
|
||||
/// @param channel 频道对象
|
||||
-(void) deleteConversation:(WKChannel*)channel;
|
||||
|
||||
/// 删除所有最近会话
|
||||
-(void) deleteAllConversation;
|
||||
/**
|
||||
更新最近会话的标题和头像
|
||||
|
||||
@param channel <#channel description#>
|
||||
@param title <#title description#>
|
||||
@param avatar <#avatar description#>
|
||||
@param db <#db description#>
|
||||
*/
|
||||
-(void) updateConversation:(WKChannel*)channel title:(NSString*)title avatar:(NSString*) avatar db:(FMDatabase*)db;
|
||||
|
||||
|
||||
//
|
||||
///**
|
||||
// 追加提醒
|
||||
//
|
||||
// @param reminder 提醒项
|
||||
// @param channel 频道
|
||||
// @return 追加后的z最近会话
|
||||
// */
|
||||
//-(WKConversation*) appendReminder:(WKReminder*) reminder channel:(WKChannel*)channel;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// 移除某种类型的提醒
|
||||
//
|
||||
// @param type <#type description#>
|
||||
// @param channel <#channel description#>
|
||||
// @return <#return value description#>
|
||||
// */
|
||||
//-(WKConversation*) removeReminder:(WKReminderType)type channel:(WKChannel*)channel;
|
||||
//
|
||||
///**
|
||||
//清除指定频道的所有提醒
|
||||
//
|
||||
// @param channel 频道
|
||||
// @return <#return value description#>
|
||||
// */
|
||||
//-(WKConversation*) clearAllReminder:(WKChannel*)channel;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// 清除指定频道指定类型的提醒
|
||||
//
|
||||
// @param channel 频道
|
||||
// @param type 提醒类型
|
||||
// @return <#return value description#>
|
||||
// */
|
||||
//-(WKConversation*) clearReminder:(WKChannel*)channel type:(NSInteger)type;
|
||||
//
|
||||
|
||||
/**
|
||||
获取所有会话未读数量
|
||||
*/
|
||||
-(NSInteger) getAllConversationUnreadCount;
|
||||
|
||||
|
||||
/// 更新频道预览的位置
|
||||
/// @param browseTo <#browseTo description#>
|
||||
/// @param channel <#channel description#>
|
||||
-(void) updateBrowseTo:(uint32_t)browseTo forChannel:(WKChannel*)channel;
|
||||
|
||||
@end
|
||||
|
||||
// 最近会话添加或修改结果
|
||||
@interface WKConversationAddOrUpdateResult : NSObject
|
||||
|
||||
@property(nonatomic,assign) BOOL insert;
|
||||
|
||||
@property(nonatomic,assign) BOOL modify; // 数据是否修改(添加或更新都为true)
|
||||
|
||||
@property(nonatomic,strong) WKConversation *conversation;
|
||||
|
||||
+(instancetype) initWithInsert:(BOOL)insert modify:(BOOL)modify conversation:(WKConversation*)conversation;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
23
ios/WuKongIMSDK.framework/Headers/WKConversationExtra.h
Normal file
23
ios/WuKongIMSDK.framework/Headers/WKConversationExtra.h
Normal file
@ -0,0 +1,23 @@
|
||||
//
|
||||
// WKConversationExtra.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2022/4/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKConversationExtra : NSObject
|
||||
|
||||
@property (nonatomic, strong) WKChannel *channel;
|
||||
//@property (nonatomic, assign) uint32_t browseTo; // 预览位置 预览到的位置,与会话保持位置不同的是 预览到的位置是用户读到的最大的messageSeq。跟未读消息数量有关系
|
||||
@property (nonatomic, assign) uint32_t keepMessageSeq; // 保持的位置的messageSeq
|
||||
@property (nonatomic, assign) NSInteger keepOffsetY; // 保持的位置Y的偏移量
|
||||
@property (nonatomic, copy) NSString *draft; // 草稿
|
||||
@property (nonatomic, assign) int64_t version; // 数据版本
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
25
ios/WuKongIMSDK.framework/Headers/WKConversationExtraDB.h
Normal file
25
ios/WuKongIMSDK.framework/Headers/WKConversationExtraDB.h
Normal file
@ -0,0 +1,25 @@
|
||||
//
|
||||
// WKConversationExtraDB.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2022/4/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKConversationExtra.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKConversationExtraDB : NSObject
|
||||
|
||||
+ (WKConversationExtraDB *)shared;
|
||||
|
||||
-(void) addOrUpdates:(NSArray<WKConversationExtra*>*)extras;
|
||||
|
||||
-(void) updateVersion:(WKChannel*)channel version:(int64_t)version;
|
||||
|
||||
-(int64_t) getMaxVersion;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,24 @@
|
||||
//
|
||||
// WKConversationLastMessageAndUnreadCount.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2022/5/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessage.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// 会话最后一条消息和需要累加的未读数量
|
||||
@interface WKConversationLastMessageAndUnreadCount : NSObject
|
||||
// 最后一条消息
|
||||
@property(nonatomic,strong) WKMessage *lastMessage;
|
||||
// 需要累加的未读数量
|
||||
@property(nonatomic,assign) NSInteger incUnreadCount;
|
||||
|
||||
// 提醒项
|
||||
//@property(nonatomic,strong) WKReminderManager *reminderManager;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
167
ios/WuKongIMSDK.framework/Headers/WKConversationManager.h
Normal file
167
ios/WuKongIMSDK.framework/Headers/WKConversationManager.h
Normal file
@ -0,0 +1,167 @@
|
||||
//
|
||||
// WKConversationManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/29.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessage.h"
|
||||
#import "WKConversation.h"
|
||||
#import "WKConversationDB.h"
|
||||
#import "WKSyncConversationModel.h"
|
||||
#import "WKConversationExtra.h"
|
||||
|
||||
@protocol WKConversationManagerDelegate;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void(^WKSyncConversationCallback)(WKSyncConversationWrapModel* __nullable model,NSError * __nullable error);
|
||||
|
||||
typedef void(^WKSyncConversationAck)(uint64_t cmdVersion,void(^ _Nullable complete)(NSError * _Nullable error));
|
||||
|
||||
// 同步会话返回 timestamp:最新会话的时间戳 lastMsgSeqs:客户端所有会话的最后一条消息序列号 格式: channelID:channelType:last_msg_seq|channelID:channelType:last_msg_seq
|
||||
typedef void (^WKSyncConversationProvider)(long long version,NSString *lastMsgSeqs,WKSyncConversationCallback callback);
|
||||
|
||||
|
||||
// 同步最近会话扩展
|
||||
typedef void(^WKSyncConversationExtraCallback)(NSArray<WKConversationExtra*>* __nullable extras,NSError * __nullable error);
|
||||
typedef void (^WKSyncConversationExtraProvider)(long long version,WKSyncConversationExtraCallback callback);
|
||||
// 更新扩展
|
||||
typedef void (^WKUpdateConversationExtraCallback)(int64_t version,NSError * __nullable error);
|
||||
typedef void (^WKUpdateConversationExtraProvider)(WKConversationExtra *extra,WKUpdateConversationExtraCallback callback);
|
||||
|
||||
|
||||
|
||||
@interface WKConversationManager : NSObject
|
||||
|
||||
/**
|
||||
获取最近会话列表
|
||||
|
||||
@return 最好会话对象集合
|
||||
*/
|
||||
-(NSArray<WKConversation*>*) getConversationList;
|
||||
|
||||
|
||||
/// 添加最近会话信息
|
||||
/// @param conversation <#conversation description#>
|
||||
-(void) addConversation:(WKConversation*)conversation;
|
||||
|
||||
/**
|
||||
清除指定频道的未读消息
|
||||
|
||||
@param channel <#channel description#>
|
||||
*/
|
||||
-(void) clearConversationUnreadCount:(WKChannel*)channel;
|
||||
|
||||
|
||||
/// 设置未读数
|
||||
/// @param channel 频道
|
||||
/// @param unread 未读数量
|
||||
-(void) setConversationUnreadCount:(WKChannel*)channel unread:(NSInteger)unread;
|
||||
|
||||
|
||||
|
||||
/// 恢复指定频道的会话
|
||||
/// @param channel <#channel description#>
|
||||
-(void) recoveryConversation:(WKChannel*)channel;
|
||||
|
||||
|
||||
|
||||
// 更新或添加扩展
|
||||
-(void) updateOrAddExtra:(WKConversationExtra*)extra;
|
||||
|
||||
// 同步最近会话扩展
|
||||
-(void) syncExtra;
|
||||
|
||||
|
||||
/// 删除最近会话
|
||||
/// @param channel 频道
|
||||
-(void) deleteConversation:(WKChannel*)channel;
|
||||
|
||||
|
||||
|
||||
/// 获取指定频道的最近会话信息
|
||||
/// @param channel <#channel description#>
|
||||
-(WKConversation*) getConversation:(WKChannel*)channel;
|
||||
|
||||
-(NSArray<WKConversation*>*) getConversations:(NSArray<WKChannel*>*)channels;
|
||||
|
||||
/**
|
||||
添加最近会话委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void) addDelegate:(id<WKConversationManagerDelegate>) delegate;
|
||||
|
||||
|
||||
/**
|
||||
移除最近会话委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void)removeDelegate:(id<WKConversationManagerDelegate>) delegate;
|
||||
|
||||
/**
|
||||
获取所有会话未读数量
|
||||
*/
|
||||
-(NSInteger) getAllConversationUnreadCount;
|
||||
|
||||
/**
|
||||
调用最近会话更新委托
|
||||
|
||||
@param conversation <#conversation description#>
|
||||
*/
|
||||
- (void)callOnConversationUpdateDelegate:(WKConversation*)conversation;
|
||||
|
||||
/// 设置同步会话提供者
|
||||
/// @param syncConversationProvider <#syncConversationProvider description#>
|
||||
/// @param syncConversationAck <#syncConversationAck description#>
|
||||
-(void) setSyncConversationProviderAndAck:(WKSyncConversationProvider) syncConversationProvider ack:(WKSyncConversationAck)syncConversationAck;
|
||||
|
||||
|
||||
|
||||
/// 同步最近会话
|
||||
@property(nonatomic,copy,readonly) WKSyncConversationProvider syncConversationProvider;
|
||||
@property(nonatomic,copy,readonly) WKSyncConversationAck syncConversationAck;
|
||||
|
||||
// 同步扩展提供者
|
||||
@property(nonatomic,copy) WKSyncConversationExtraProvider syncConversationExtraProvider;
|
||||
// 更新扩展提供者
|
||||
@property(nonatomic,copy) WKUpdateConversationExtraProvider updateConversationExtraProvider;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@protocol WKConversationManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
最近会话更新
|
||||
*/
|
||||
- (void)onConversationUpdate:(NSArray<WKConversation*>*)conversations;
|
||||
|
||||
/**
|
||||
最近会话未读数更新
|
||||
|
||||
@param channel 频道
|
||||
@param unreadCount 未读数量
|
||||
*/
|
||||
- (void)onConversationUnreadCountUpdate:(WKChannel*)channel unreadCount:(NSInteger)unreadCount;
|
||||
|
||||
|
||||
/// 最近会话被删除
|
||||
/// @param channel <#channel description#>
|
||||
-(void) onConversationDelete:(WKChannel*)channel;
|
||||
|
||||
|
||||
/// 所有最近会话删除
|
||||
-(void) onConversationAllDelete;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,49 @@
|
||||
//
|
||||
// WKConversationManagerInner.h
|
||||
// Pods
|
||||
//
|
||||
// Created by tt on 2022/5/27.
|
||||
//
|
||||
|
||||
#ifndef WKConversationManagerInner_h
|
||||
#define WKConversationManagerInner_h
|
||||
|
||||
|
||||
#endif /* WKConversationManagerInner_h */
|
||||
|
||||
|
||||
@interface WKConversationManager ()
|
||||
|
||||
/**
|
||||
添加或更新最近会话
|
||||
|
||||
@param conversation conversation
|
||||
@param incUnreadCount 未读数递增数量
|
||||
*/
|
||||
-(WKConversationAddOrUpdateResult*) addOrUpdateConversation:(WKConversation*)conversation incUnreadCount:(NSInteger)incUnreadCount;
|
||||
|
||||
-(WKConversationAddOrUpdateResult*) addOrUpdateConversation:(WKConversation*)cs;
|
||||
|
||||
/// 处理同步下来的最近会话
|
||||
/// @param model 会话同步对象
|
||||
-(void) handleSyncConversation:(WKSyncConversationWrapModel*)model;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
调用最近会话更新委托
|
||||
|
||||
@param conversations 会话数组
|
||||
*/
|
||||
- (void)callOnConversationUpdateDelegates:(NSArray<WKConversation*>*)conversations;
|
||||
|
||||
|
||||
/// 调用删除所有最近会话委托
|
||||
- (void)callOnConversationAllDeleteDelegate;
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
17
ios/WuKongIMSDK.framework/Headers/WKConversationUtil.h
Normal file
17
ios/WuKongIMSDK.framework/Headers/WKConversationUtil.h
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// WKConversationUtil.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/24.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKConversation.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKConversationUtil : NSObject
|
||||
// 合并提醒数据
|
||||
+(NSArray<WKReminder*>*) mergeReminders:(NSArray<WKReminder*>*)source dest:(NSArray<WKReminder*>*)dest;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
39
ios/WuKongIMSDK.framework/Headers/WKDB.h
Normal file
39
ios/WuKongIMSDK.framework/Headers/WKDB.h
Normal file
@ -0,0 +1,39 @@
|
||||
//
|
||||
// WKDB.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <fmdb/FMDB.h>
|
||||
#import "WKFMDatabaseQueue.h"
|
||||
//消息表
|
||||
#define TB_MESSAGE @"message"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKDB : NSObject
|
||||
|
||||
@property (nonatomic, strong) WKFMDatabaseQueue *dbQueue;
|
||||
|
||||
+ (WKDB *)sharedDB;
|
||||
|
||||
/**
|
||||
切换用户的数据库
|
||||
|
||||
@param uid 用户uid
|
||||
*/
|
||||
-(void) switchDB:(NSString*)uid;
|
||||
|
||||
/**
|
||||
是否需要切换数据库
|
||||
|
||||
@param uid <#uid description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(BOOL) needSwitchDB:(NSString*)uid;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
294
ios/WuKongIMSDK.framework/Headers/WKDBMigrationManager.h
Normal file
294
ios/WuKongIMSDK.framework/Headers/WKDBMigrationManager.h
Normal file
@ -0,0 +1,294 @@
|
||||
//
|
||||
// WKDBMigrationManager.h
|
||||
// WKDBMigrationManager
|
||||
//
|
||||
// Created by Blake Watters on 6/4/14.
|
||||
// Copyright (c) 2014 Layer Inc. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#import <fmdb/FMDatabase.h>
|
||||
#import <fmdb/FMDatabaseQueue.h>
|
||||
|
||||
@protocol WKDBMigrating;
|
||||
|
||||
/**
|
||||
@abstract The `WKDBMigrationManager` class provides a simple, flexible interface for managing migrations for
|
||||
a SQLite database that is accessed via FMDB.
|
||||
*/
|
||||
@interface WKDBMigrationManager : NSObject
|
||||
|
||||
///-----------------------------------
|
||||
/// @name Creating a Migration Manager
|
||||
///-----------------------------------
|
||||
|
||||
/**
|
||||
@abstract Creates a new migration manager with a given database and migrations bundle.
|
||||
@param database The database with which to initialize the migration manager.
|
||||
@return A new migration manager.
|
||||
*/
|
||||
+ (instancetype)managerWithDatabase:(FMDatabase *)database;
|
||||
|
||||
/**
|
||||
@abstract Creates a new migration manager with a database for the given database and migrations bundle.
|
||||
@param path The path to a database with which to initialize the migration manager.
|
||||
@return A new migration manager.
|
||||
*/
|
||||
+ (instancetype)managerWithDatabaseAtPath:(NSString *)path;
|
||||
|
||||
/**
|
||||
@abstract Determines whether the receiver will perform a search for dynamically defined migrations. Default: `YES`.
|
||||
@discussion When `YES` all classes will be enumerated to search for any that conform to the `WKDBMigrating` protocol.
|
||||
*/
|
||||
@property (nonatomic, assign) BOOL dynamicMigrationsEnabled;
|
||||
|
||||
///--------------------------------------------------
|
||||
/// @name Accessing Database Path & Migrations Bundle
|
||||
///--------------------------------------------------
|
||||
|
||||
/**
|
||||
@abstract Returns the database of the receiver.
|
||||
*/
|
||||
@property (nonatomic, readonly) FMDatabase *database;
|
||||
|
||||
/**
|
||||
@abstract Returns the migrations bundle for the receiver.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSBundle *migrationsBundle;
|
||||
|
||||
///-----------------------------
|
||||
/// @name Accessing Version Info
|
||||
///-----------------------------
|
||||
|
||||
/**
|
||||
@abstract Returns the current version of the database managed by the receiver or `0` if the
|
||||
migrations table is not present.
|
||||
*/
|
||||
@property (nonatomic, readonly) uint64_t currentVersion;
|
||||
|
||||
/**
|
||||
@abstract Returns the origin version of the database managed by the receiver or `0` if the
|
||||
migrations table is not present.
|
||||
*/
|
||||
@property (nonatomic, readonly) uint64_t originVersion;
|
||||
|
||||
///---------------------------
|
||||
/// @name Accessing Migrations
|
||||
///---------------------------
|
||||
|
||||
/**
|
||||
@abstract Returns all migrations discovered by the receiver. Each object returned conforms to the `WKDBMigrating` protocol. The
|
||||
array is returned in ascending order by version.
|
||||
@discussion The manager discovers migrations by analyzing all files that end in a .sql extension in the `migrationsBundle`
|
||||
and accumulating all classes that conform to the `WKDBMigrating` protocol. These migrations can then be sorted and applied
|
||||
to the target database.
|
||||
@note The list of migrations is memoized for efficiency.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSArray *migrations;
|
||||
|
||||
/**
|
||||
@abstract Returns the version numbers of the subset of `migrations` that have already been applied to the database
|
||||
managed by the receiver in ascending order.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSArray *appliedVersions;
|
||||
|
||||
/**
|
||||
@abstract Returns the version numbers of the subset of `migrations` that have not yet been applied to the database
|
||||
managed by the receiver in ascending order.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSArray *pendingVersions;
|
||||
|
||||
/**
|
||||
@abstract Returns a migration object with a given version number or `nil` if none could be found.
|
||||
@param version The version of the desired migration.
|
||||
@return A migration with the specified version or `nil` if none could be found.
|
||||
*/
|
||||
- (id<WKDBMigrating>)migrationForVersion:(uint64_t)version;
|
||||
|
||||
/**
|
||||
@abstract Returns a migration object with a given name or `nil` if none could be found.
|
||||
@param name The name of the desired migration.
|
||||
@return A migration with the specified named or `nil` if none could be found.
|
||||
*/
|
||||
- (id<WKDBMigrating>)migrationForName:(NSString *)name;
|
||||
|
||||
///-------------------------
|
||||
/// @name Adding a Migration
|
||||
///-------------------------
|
||||
|
||||
/**
|
||||
@abstract Adds a migration to the receiver's list.
|
||||
@discussion This method can be used to append code based migrations to the set if you do not wish to use dynamic migration discovery. If
|
||||
the migration last has been previously computed, adding a migration will recompute the list.
|
||||
@param migration The migration to add.
|
||||
*/
|
||||
- (void)addMigration:(id<WKDBMigrating>)migration;
|
||||
|
||||
/**
|
||||
@abstract Adds migrations from the array to the receiver's list.
|
||||
@discussion This method can be used to append code based migrations to the set if you do not wish to use dynamic migration discovery. If
|
||||
the migration last has been previously computed, adding migrations will recompute the list.
|
||||
@param migrations An array of objects conforming to `WKDBMigrating` protocol.
|
||||
*/
|
||||
- (void)addMigrations:(NSArray *)migrations;
|
||||
|
||||
///------------------------------------
|
||||
/// @name Managing the Migrations Table
|
||||
///------------------------------------
|
||||
|
||||
/**
|
||||
@abstract Returns a Boolean value that indicates if the `schema_migrations` table
|
||||
is present in the database.
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL hasMigrationsTable;
|
||||
|
||||
/**
|
||||
@abstract Creates the `schema_migrations` table used by `WKDBMigrationManager` to maintain an index of applied migrations.
|
||||
@param error A pointer to an error object that is set upon failure to create the migrations table.
|
||||
@return A Boolean value that indicates if the creation of the migrations table was successful.
|
||||
*/
|
||||
- (BOOL)createMigrationsTable:(NSError **)error;
|
||||
|
||||
///--------------------------
|
||||
/// @name Migrating Databases
|
||||
///--------------------------
|
||||
|
||||
/**
|
||||
@abstract Returns a Boolean value that indicates if the database managed by the receiver is in need of migration.
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL needsMigration;
|
||||
|
||||
/**
|
||||
@abstract Migrates the database managed by the receiver to the specified version, optionally providing progress via a block.
|
||||
@discussion Migration is performed within a transaction that is rolled back if any errors occur during migration.
|
||||
@param version The target version to migrate the database to. Pass `UINT64_MAX` to migrate to the latest version.
|
||||
@param progressBlock An optional block to be invoked each time a migration is applied. The block has no return value and accepts a single `NSProgress` argument. The
|
||||
progress object can be used to cancel a migration in progress.
|
||||
@param error A pointer to an error object that is set upon failure to complete the migrations.
|
||||
@return `YES` if migration was successful, else `NO`.
|
||||
*/
|
||||
|
||||
- (BOOL)migrateDatabaseToVersion:(uint64_t)version bundle:(NSBundle*)migrationsBundle progress:(void (^)(NSProgress *progress))progressBlock error:(NSError **)error;
|
||||
|
||||
- (BOOL)migrateDatabase:(NSBundle*)migrationsBundle error:(NSError **)error;
|
||||
|
||||
@end
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
@abstract The `WKDBMigrating` protocol is adopted by classes that wish to provide migration of SQLite databases accessed via FMDB. The
|
||||
`WKDBMigrationManager` project ships with a single concrete implementation in the `FMDBFileMigration` class. Non file backed
|
||||
migrations can be implemented by conforming to the `WKDBMigrating` protocol.
|
||||
*/
|
||||
@protocol WKDBMigrating <NSObject>
|
||||
|
||||
///-------------------------------------
|
||||
/// @name Accessing Migration Properties
|
||||
///-------------------------------------
|
||||
|
||||
/**
|
||||
@abstract The name of the migration.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSString *name;
|
||||
|
||||
/**
|
||||
@abstract The numeric version of the migration.
|
||||
@discussion While monotonically incremented versions are fully supported, it is recommended that to use a timestamp format such as
|
||||
201406063106474. Timestamps avoid unnecessary churn in a codebase that is heavily branched.
|
||||
*/
|
||||
@property (nonatomic, readonly) uint64_t version;
|
||||
|
||||
///--------------------------
|
||||
/// @name Migrating Databases
|
||||
///--------------------------
|
||||
|
||||
/**
|
||||
@abstract Tells the receiver to apply its changes to the given database and return a Boolean value indicating success or failure.
|
||||
@discussion The `WKDBMigrationManager` manages a transaction while migrations are being applied. Should any call to `migrateDatabase:error` return `NO`,
|
||||
then the transaction is rolled back.
|
||||
@param database The database on which to apply the migration.
|
||||
@param error A pointer to an error object to set should the transaction fail.
|
||||
@return A Boolean value indicating if the
|
||||
*/
|
||||
- (BOOL)migrateDatabase:(FMDatabase *)database error:(out NSError *__autoreleasing *)error;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
@abstract The `FMDBFileMigration` class provides a concrete implementation of the `WKDBMigrating` protocol that models
|
||||
a migration stored on disk a SQL file. The filename encodes the name and version of the migration. Conformant filenames are
|
||||
of the form `[version]_[name].sql`.
|
||||
*/
|
||||
@interface WKDBFileMigration : NSObject <WKDBMigrating>
|
||||
|
||||
///--------------------------------
|
||||
/// @name Creating a File Migration
|
||||
///--------------------------------
|
||||
|
||||
/**
|
||||
@abstract Creates and returns a new migration with the file at the given path.
|
||||
@discussion Conformance of filenames can be evaluated with the `FMDBIsMigrationAtPath` utility function.
|
||||
@param path The path to a file containing a SQL migration with a conformant filename.
|
||||
*/
|
||||
+ (instancetype)migrationWithPath:(NSString *)path;
|
||||
|
||||
/**
|
||||
@abstract The path to the SQL migration file on disk.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSString *path;
|
||||
|
||||
/**
|
||||
@abstract A convenience accessor for retrieving the SQL from the receiver's path.
|
||||
*/
|
||||
@property (nonatomic, readonly) NSString *SQL;
|
||||
|
||||
@end
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
@abstract The domain for errors created by `WKDBMigrationManager`.
|
||||
*/
|
||||
extern NSString *const WKDBMigrationManagerErrorDomain;
|
||||
|
||||
/**
|
||||
@abstract A key for an `NSNumber` object in the `userInfo` of an `NSProgress` object specifying the version
|
||||
that the database was just migrated to.
|
||||
@see `migrateDatabase:error:`
|
||||
*/
|
||||
extern NSString *const WKDBMigrationManagerProgressVersionUserInfoKey;
|
||||
|
||||
/**
|
||||
@abstract A key for an `id<WKDBMigrating>` object in the `userInfo` of an `NSProgress` object that identifies
|
||||
the migration that was just applied to the database.
|
||||
@see `migrateDatabase:error:`
|
||||
*/
|
||||
extern NSString *const WKDBMigrationManagerProgressMigrationUserInfoKey;
|
||||
|
||||
/**
|
||||
@abstract Enumerates the errors returned by WKDBMigrationManager
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, WKDBMigrationManagerError) {
|
||||
/// Indicates that migration was halted due to cancellation
|
||||
WKDBMigrationManagerErrorMigrationCancelled = 1
|
||||
};
|
||||
|
||||
/**
|
||||
@abstract Returns a Boolean value that indicates if the file at the given path is an FMDB Migration.
|
||||
@discussion This function evaluates the last path component of the input string against the regular expression `/\d{1,15}_.+sql$/`.
|
||||
@param path The path to inspect.
|
||||
@return `YES` if the path could be identified as a migration, else `NO`.
|
||||
*/
|
||||
BOOL FMDBIsMigrationAtPath(NSString *path);
|
71
ios/WuKongIMSDK.framework/Headers/WKData.h
Normal file
71
ios/WuKongIMSDK.framework/Headers/WKData.h
Normal file
@ -0,0 +1,71 @@
|
||||
//
|
||||
// WKData.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/25.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKDataWrite : NSObject
|
||||
|
||||
|
||||
/// 初始化(大端模式)
|
||||
+(instancetype) initLittleEndian;
|
||||
|
||||
-(void) writeUint8:(uint8_t)v;
|
||||
|
||||
-(void) writeUint16:(uint16_t)v;
|
||||
|
||||
-(void) writeUint32:(uint32_t)v;
|
||||
|
||||
-(void) writeUint64:(uint64_t)v;
|
||||
|
||||
|
||||
/// 写可变字符串 (前2位为字符串长度)
|
||||
/// @param v <#v description#>
|
||||
-(void) writeVariableString:(NSString*)v;
|
||||
|
||||
-(void) writeData:(NSData*) data;
|
||||
|
||||
|
||||
-(NSData*) toData;
|
||||
@end
|
||||
|
||||
@interface WKDataRead : NSObject
|
||||
|
||||
-(instancetype) initWithData:(NSData*) data;
|
||||
|
||||
-(instancetype) initWithData:(NSData*) data littleEndian:(BOOL)littleEndian;
|
||||
|
||||
-(uint8_t) readUint8;
|
||||
|
||||
-(uint16_t) readUint16;
|
||||
|
||||
-(uint32_t) readUint32;
|
||||
|
||||
-(uint64_t) readUint64;
|
||||
|
||||
-(int64_t) readint64;
|
||||
|
||||
|
||||
/// 读取指定长度的data
|
||||
/// @param len <#len description#>
|
||||
-(NSData*) readData:(int)len;
|
||||
|
||||
-(NSString*) readString;
|
||||
|
||||
-(uint32_t) readLenth;
|
||||
// 字节里是否包含完整的长度
|
||||
-(BOOL) lengthFull;
|
||||
// 长度的长度
|
||||
-(int) lenthLength;
|
||||
-(NSData*) remainingData;
|
||||
|
||||
+(void) numberHNMemcpy:(void*)dest src:(const void *)src count:(unsigned int)count;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
22
ios/WuKongIMSDK.framework/Headers/WKDisconnectPacket.h
Normal file
22
ios/WuKongIMSDK.framework/Headers/WKDisconnectPacket.h
Normal file
@ -0,0 +1,22 @@
|
||||
//
|
||||
// WKDisconnectPacket.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/30.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
#import "WKPacketBodyCoder.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKDisconnectPacket : WKPacket<WKPacketBodyCoder>
|
||||
|
||||
// 原因代码
|
||||
@property(nonatomic,assign) uint8_t reasonCode;
|
||||
// 原因字符串
|
||||
@property(nonatomic,copy) NSString *reason;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
26
ios/WuKongIMSDK.framework/Headers/WKFMDatabaseQueue.h
Normal file
26
ios/WuKongIMSDK.framework/Headers/WKFMDatabaseQueue.h
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// WKFMDatabaseQueue.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/8/26.
|
||||
//
|
||||
|
||||
#import <fmdb/FMDB.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKFMDatabaseQueue : NSObject
|
||||
|
||||
|
||||
+(WKFMDatabaseQueue*) databaseQueue:(FMDatabaseQueue*)queue;
|
||||
|
||||
|
||||
- (void)inDatabase:(void (NS_NOESCAPE^)(FMDatabase * _Nonnull db))block;
|
||||
|
||||
- (void)inTransaction:(__attribute__((noescape)) void (^)(FMDatabase *db, BOOL *rollback))block;
|
||||
|
||||
-(void) close;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
42
ios/WuKongIMSDK.framework/Headers/WKFileUtil.h
Normal file
42
ios/WuKongIMSDK.framework/Headers/WKFileUtil.h
Normal file
@ -0,0 +1,42 @@
|
||||
//
|
||||
// WKFileUtil.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/13.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKFileUtil : NSObject
|
||||
+(BOOL)copyFileFromPath:(NSString *)fromPath toPath:(NSString *)toPath;
|
||||
|
||||
+ (BOOL)moveFileFromPath:(NSString *)fromPath toPath:(NSString *)toPath;
|
||||
|
||||
+ (BOOL)fileIsExistOfPath:(NSString *)filePath;
|
||||
|
||||
|
||||
/**
|
||||
如果目录不存在,则创建目录
|
||||
|
||||
@param dirPath 目录路径
|
||||
@return <#return value description#>
|
||||
*/
|
||||
+(BOOL)createDirectoryIfNotExist:(NSString *)dirPath;
|
||||
|
||||
|
||||
/**
|
||||
如果文件不存在,则创建文件
|
||||
|
||||
@param filePath 文件路径
|
||||
@return <#return value description#>
|
||||
*/
|
||||
+ (BOOL)creatFileIfNotExist:(NSString *)filePath;
|
||||
|
||||
+ (BOOL)removeFileOfPath:(NSString *)filePath;
|
||||
|
||||
+ (BOOL)removeFileOfURL:(NSURL *)fileURL;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
28
ios/WuKongIMSDK.framework/Headers/WKFlameManager.h
Normal file
28
ios/WuKongIMSDK.framework/Headers/WKFlameManager.h
Normal file
@ -0,0 +1,28 @@
|
||||
//
|
||||
// WKViewedManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2022/8/17.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessage.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKFlameManager : NSObject
|
||||
|
||||
+ (WKFlameManager *)shared;
|
||||
|
||||
/**
|
||||
标记为已读
|
||||
*/
|
||||
-(void) didViewed:(NSArray<WKMessage*>*) messages;
|
||||
|
||||
/**
|
||||
获取需要焚烧的消息(阅后即焚)
|
||||
*/
|
||||
-(NSArray<WKMessage*>*) getMessagesOfNeedFlame;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
30
ios/WuKongIMSDK.framework/Headers/WKHeader.h
Normal file
30
ios/WuKongIMSDK.framework/Headers/WKHeader.h
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// WKHeader.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/25.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKHeader : NSObject
|
||||
|
||||
// 剩余长度
|
||||
@property(nonatomic,assign) uint32_t remainLength;
|
||||
// 包类型
|
||||
@property(nonatomic,assign) uint8_t packetType;
|
||||
|
||||
// 是否显示未读
|
||||
@property(nonatomic,assign) BOOL showUnread; // RedDot
|
||||
|
||||
// 是否不存储
|
||||
@property(nonatomic,assign) BOOL noPersist;
|
||||
|
||||
// 是否同步一次
|
||||
@property(nonatomic,assign) BOOL syncOnce;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
73
ios/WuKongIMSDK.framework/Headers/WKImageContent.h
Normal file
73
ios/WuKongIMSDK.framework/Headers/WKImageContent.h
Normal file
@ -0,0 +1,73 @@
|
||||
//
|
||||
// WKImageMessageContent.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/13.
|
||||
// 图片消息content
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "WKMediaMessageContent.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKImageContent : WKMediaMessageContent
|
||||
|
||||
|
||||
@property(nonatomic,assign) CGFloat width; // 图片宽度
|
||||
|
||||
@property(nonatomic,assign) CGFloat height; // 图片高度
|
||||
|
||||
/*!
|
||||
初始化图片消息
|
||||
|
||||
@param image 原始图片
|
||||
@return 图片消息对象
|
||||
*/
|
||||
+ (instancetype)initWithImage:(UIImage *)image;
|
||||
|
||||
|
||||
|
||||
/// 通过data初始化
|
||||
/// @param data 图片数据
|
||||
/// @param width 图片宽度
|
||||
/// @param height 图片高度
|
||||
+ (instancetype)initWithData:(NSData *)data width:(CGFloat)width height:(CGFloat)height;
|
||||
|
||||
|
||||
/// 初始化
|
||||
/// @param data 原图data
|
||||
/// @param width 原图宽度
|
||||
/// @param height 原图高度
|
||||
/// @param thumbData 缩略图data (如果传了缩略图的data数据,sdk将不再生成缩略图数据)
|
||||
+ (instancetype)initWithData:(NSData *)data width:(CGFloat)width height:(CGFloat)height thumbData:( nullable NSData*)thumbData;
|
||||
|
||||
|
||||
/*!
|
||||
是否发送原图
|
||||
|
||||
@discussion 在发送图片的时候,是否发送原图,默认值为NO。
|
||||
*/
|
||||
@property (nonatomic, getter=isFull) BOOL full;
|
||||
|
||||
/*!
|
||||
图片消息的缩略图
|
||||
*/
|
||||
@property (nonatomic, strong,nullable) UIImage *thumbnailImage;
|
||||
|
||||
@property (nonatomic, strong,readonly) NSData *thumbnailData;
|
||||
|
||||
/*!
|
||||
图片消息的原始图片信息
|
||||
*/
|
||||
@property (nonatomic, strong,readonly) UIImage *originalImage;
|
||||
|
||||
/*!
|
||||
图片消息的原始图片信息
|
||||
*/
|
||||
@property (nonatomic, strong, readonly) NSData *originalImageData;
|
||||
|
||||
-(void) releaseData;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,28 @@
|
||||
//
|
||||
// WKMOSContentConvertManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/6/5.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessage.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKMOSContentConvertManager : NSObject
|
||||
|
||||
+ (WKMOSContentConvertManager *)shared;
|
||||
|
||||
// 将mos的content转换为lm的content(TODO:为了兼容lm协议,如果没有指定mos协议不用管此方法)
|
||||
-(NSDictionary*) convertContentToLM:(NSDictionary *)contentDic message:(WKMessage*)message;
|
||||
// 将lm的content转换为mos的content (TODO:为了兼容lm协议,如果没有指定mos协议不用管此方法)
|
||||
-(NSDictionary*) convertContentToMOS:(NSDictionary *)contentDic message:(WKMessage*)message;
|
||||
|
||||
|
||||
/// 将mos正文类型转换为lm的正文类型
|
||||
/// @param mosContentType <#mosContentType description#>
|
||||
-(NSInteger) convertTypeToLM:(NSInteger)mosContentType;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
188
ios/WuKongIMSDK.framework/Headers/WKMediaManager.h
Normal file
188
ios/WuKongIMSDK.framework/Headers/WKMediaManager.h
Normal file
@ -0,0 +1,188 @@
|
||||
//
|
||||
// WKMediaManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/13.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMediaProto.h"
|
||||
#import "WKMessage.h"
|
||||
#import "WKTaskProto.h"
|
||||
#import "WKTaskManager.h"
|
||||
#import <CoreGraphics/CGBase.h>
|
||||
#import <AVFoundation/AVFoundation.h>
|
||||
#import "WKMessageFileDownloadTask.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKMediaUploadStateProcessing = 0,
|
||||
WKMediaUploadStateSuccess = 1,
|
||||
WKMediaUploadStateFail = 2,
|
||||
} WKMediaUploadState;
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKMediaDownloadStateProcessing = 0,
|
||||
WKMediaDownloadStateSuccess = 1,
|
||||
WKMediaDownloadStateFail = 2,
|
||||
} WKMediaDownloadState;
|
||||
|
||||
@interface WKFileInfo : NSObject
|
||||
|
||||
@property(nonatomic,copy) NSString *fid; // 文件唯一id
|
||||
@property(nonatomic,copy) NSString *name; // 文件名
|
||||
@property(nonatomic,assign) long size; // 文件大小(单位byte)
|
||||
@property(nonatomic,copy) NSString *url; // 文件路径
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
多媒体委托
|
||||
*/
|
||||
@protocol WKMediaManagerDelegate <NSObject>
|
||||
|
||||
|
||||
/**
|
||||
媒体文件数据更新
|
||||
|
||||
@param media 媒体文件
|
||||
*/
|
||||
-(void) mediaManageUpdate:(id<WKMediaProto>)media;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/**
|
||||
多媒体上传任务提供者
|
||||
*/
|
||||
typedef id<WKTaskProto>_Nonnull(^WKMediaUploadTaskProvider)(WKMessage* message);
|
||||
|
||||
/**
|
||||
多媒体下载任务提供者
|
||||
*/
|
||||
typedef id<WKTaskProto>_Nonnull(^WKMediaDownloadTaskProvider)(WKMessage* message);
|
||||
|
||||
// 音频播放完成block
|
||||
typedef void(^WKAudioPlayerDidFinishBlock)(AVAudioPlayer *player,BOOL successFlag);
|
||||
|
||||
// 音频播放进度
|
||||
typedef void (^WKAudioPlayerDidProgressBlock)(AVAudioPlayer *player);
|
||||
|
||||
@interface WKMediaManager : NSObject
|
||||
|
||||
+ (WKMediaManager *)shared;
|
||||
|
||||
@property(nonatomic,strong) WKTaskManager *taskManager;
|
||||
/**
|
||||
添加媒体委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void) addDelegate:(id<WKMediaManagerDelegate>) delegate;
|
||||
|
||||
|
||||
/**
|
||||
移除媒体委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void)removeDelegate:(id<WKMediaManagerDelegate>) delegate;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
下载任务提供者
|
||||
*/
|
||||
@property(nonatomic,copy) WKMediaDownloadTaskProvider downloadTaskProvider;
|
||||
/**
|
||||
上传任务提供者
|
||||
*/
|
||||
@property(nonatomic,copy) WKMediaUploadTaskProvider uploadTaskProvider;
|
||||
|
||||
/**
|
||||
上传消息里的多媒体
|
||||
|
||||
@param message 消息
|
||||
*/
|
||||
-(void) upload:(WKMessage*) message;
|
||||
|
||||
|
||||
/**
|
||||
下载消息的多媒体文件
|
||||
|
||||
@param message <#message description#>
|
||||
*/
|
||||
-(WKMessageFileDownloadTask*) download:(WKMessage*)message;
|
||||
|
||||
|
||||
/**
|
||||
下载消息的多媒体文件
|
||||
|
||||
@param message 消息对象
|
||||
@param callback 下载回调
|
||||
*/
|
||||
-(WKMessageFileDownloadTask*) download:(WKMessage*)message callback:(void(^ __nullable)(WKMediaDownloadState state,CGFloat progress,NSError * __nullable error))callback;
|
||||
|
||||
///**
|
||||
// 获取上传进度
|
||||
//
|
||||
// @param message 消息
|
||||
// @return <#return value description#>
|
||||
// */
|
||||
//-(CGFloat) getUploadProgress:(WKMessage*)message;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// 获取下载进度
|
||||
//
|
||||
// @param message 消息
|
||||
// @return <#return value description#>
|
||||
// */
|
||||
//-(CGFloat) getDowloadProgress:(WKMessage*)message;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
将音频消息的副本转换为源文件
|
||||
|
||||
@param message <#message description#>
|
||||
*/
|
||||
-(void) voiceMessageThumbToSource:(WKMessage*)message;
|
||||
|
||||
/**
|
||||
* 是否正在播放音频
|
||||
*
|
||||
*/
|
||||
- (BOOL)isAudioPlaying;
|
||||
|
||||
/**
|
||||
* 播放音频文件
|
||||
*
|
||||
* @param filePath 文件路径
|
||||
*/
|
||||
-(void) playAudio:(NSString *)filePath playerDidFinish:(WKAudioPlayerDidFinishBlock)finishBlock progress:(WKAudioPlayerDidProgressBlock)progressBlock;
|
||||
|
||||
/**
|
||||
* 停止播放音频
|
||||
*/
|
||||
- (void)stopAudioPlay;
|
||||
|
||||
/**
|
||||
暂停播放
|
||||
*/
|
||||
-(void) pauseAudioPlay;
|
||||
|
||||
/**
|
||||
继续播放
|
||||
*/
|
||||
-(void) continuePlay;
|
||||
|
||||
// 获取所有消息缓存大小
|
||||
-(long long) messageCacheSize;
|
||||
|
||||
-(void) cleanMessageCache;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
18
ios/WuKongIMSDK.framework/Headers/WKMediaMessageContent.h
Normal file
18
ios/WuKongIMSDK.framework/Headers/WKMediaMessageContent.h
Normal file
@ -0,0 +1,18 @@
|
||||
//
|
||||
// WKMediaMessageContent.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/13.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessageContent.h"
|
||||
#import "WKMediaProto.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKMediaMessageContent : WKMessageContent<WKMediaProto>
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
63
ios/WuKongIMSDK.framework/Headers/WKMediaProto.h
Normal file
63
ios/WuKongIMSDK.framework/Headers/WKMediaProto.h
Normal file
@ -0,0 +1,63 @@
|
||||
//
|
||||
// WKMediaMessageContentProto.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/13.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessage.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol WKMediaProto <NSObject>
|
||||
|
||||
/**
|
||||
消息
|
||||
*/
|
||||
@property (nonatomic, weak) WKMessage *message; //TODO: 这里要注意不能声明为strong 如果声明为strong message和media互相引用 就释放不掉了导致内存爆炸。
|
||||
|
||||
/**
|
||||
媒体内容的本地路径(当remoteUrl为空时此属性必须有值)
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *localPath;
|
||||
|
||||
/**
|
||||
媒体内容上传服务器后的网络地址(上传成功后SDK会为该属性赋值)
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *remoteUrl;
|
||||
|
||||
|
||||
/**
|
||||
源文件扩展
|
||||
*/
|
||||
@property(nullable,nonatomic,copy) NSString *extension;
|
||||
|
||||
/**
|
||||
副本路径
|
||||
*/
|
||||
@property(nullable,nonatomic,copy) NSString *thumbPath;
|
||||
|
||||
|
||||
/**
|
||||
副本的扩展名
|
||||
*/
|
||||
@property(nullable,nonatomic,copy) NSString *thumbExtension;
|
||||
|
||||
/**
|
||||
保存数据到本地路径
|
||||
多媒体上传前会调用此方法,请在此方法里将NSData数据保存到localPath对应的位置。
|
||||
如果继承WKMediaMessageContent必须调用 [super writeDataToLocalPath]
|
||||
*/
|
||||
-(void) writeDataToLocalPath;
|
||||
|
||||
|
||||
// 从本地扩展数据里获取值
|
||||
-(nullable id) getExtra:(NSString*)key;
|
||||
|
||||
// 设置值到本地扩展字段内
|
||||
-(void) setExtra:(id)value key:(NSString*)key;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
43
ios/WuKongIMSDK.framework/Headers/WKMediaUtil.h
Normal file
43
ios/WuKongIMSDK.framework/Headers/WKMediaUtil.h
Normal file
@ -0,0 +1,43 @@
|
||||
//
|
||||
// WKMediaUtils.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/13.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMediaProto.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKMediaUtil : NSObject
|
||||
|
||||
|
||||
/**
|
||||
获取媒体本地路径
|
||||
|
||||
@param media <#media description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
+(NSString*) getLocalPath:(id<WKMediaProto>)media;
|
||||
|
||||
|
||||
/**
|
||||
获取媒体副本本地路径
|
||||
|
||||
@param media <#media description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
+(NSString*) getThumbLocalPath:(id<WKMediaProto>)media;
|
||||
|
||||
|
||||
/**
|
||||
获取频道的存储目录
|
||||
|
||||
@param channel <#channel description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
+(NSString*) getChannelDir:(WKChannel*) channel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
39
ios/WuKongIMSDK.framework/Headers/WKMemoryCache.h
Normal file
39
ios/WuKongIMSDK.framework/Headers/WKMemoryCache.h
Normal file
@ -0,0 +1,39 @@
|
||||
//
|
||||
// WKCache.h
|
||||
// WuKongIMBase
|
||||
//
|
||||
// Created by tt on 2020/1/11.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKMemoryCache : NSObject
|
||||
|
||||
|
||||
/**
|
||||
最大缓存数量 默认不限制
|
||||
*/
|
||||
@property(nonatomic,assign) NSInteger maxCacheNum;
|
||||
|
||||
/**
|
||||
设置缓存
|
||||
|
||||
@param value 值
|
||||
@param key 键
|
||||
*/
|
||||
-(void) setCache:(id __nullable)value forKey:(NSString*)key;
|
||||
|
||||
|
||||
/**
|
||||
获取缓存
|
||||
|
||||
@param key 键
|
||||
@return 值
|
||||
*/
|
||||
-(id) getCache:(NSString*)key;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
104
ios/WuKongIMSDK.framework/Headers/WKMessage.h
Normal file
104
ios/WuKongIMSDK.framework/Headers/WKMessage.h
Normal file
@ -0,0 +1,104 @@
|
||||
//
|
||||
// WKMessage.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
#import "WKMessageContent.h"
|
||||
#import "WKChannelInfo.h"
|
||||
#import "WKConst.h"
|
||||
#import "WKChannelMemberDB.h"
|
||||
#import "WKTaskProto.h"
|
||||
#import "WKSetting.h"
|
||||
#import "WKMessageExtra.h"
|
||||
#import "WKReaction.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
@interface WKMessageHeader : NSObject
|
||||
// 是否红点
|
||||
// 是否显示未读
|
||||
@property(nonatomic,assign) BOOL showUnread; // RedDot
|
||||
|
||||
// 是否不存储
|
||||
@property(nonatomic,assign) BOOL noPersist;
|
||||
|
||||
@property(nonatomic,assign) BOOL syncOnce; // 同步一次标记
|
||||
|
||||
@end
|
||||
|
||||
@interface WKMessage : NSObject
|
||||
|
||||
@property(nonatomic,strong) WKMessageHeader *header; // 消息头
|
||||
|
||||
@property(nonatomic,strong) WKSetting *setting; // 消息设置
|
||||
|
||||
@property(nonatomic,assign) uint32_t clientSeq; // 客户端序列号 (客户端提供,服务端原样返回)
|
||||
|
||||
@property(nonatomic,copy) NSString *clientMsgNo; /// 客户端消息唯一编号(相同clientMsgNo被认为是重复消息)
|
||||
|
||||
@property(nonatomic,assign) uint64_t messageId; // 消息ID(全局唯一)
|
||||
|
||||
@property(nonatomic,assign) uint32_t messageSeq; // 消息序列号(用户唯一,有序)
|
||||
|
||||
@property(nonatomic,assign) uint32_t orderSeq; // 消息排序号(消息越新序号越大)
|
||||
|
||||
@property(nonatomic,assign) NSInteger timestamp; // 消息时间(服务器时间,单位秒)
|
||||
|
||||
@property(nonatomic,assign) NSInteger localTimestamp; // 本地消息创建时间
|
||||
|
||||
@property(nonatomic,strong) WKChannelInfo *from; // 发送者
|
||||
|
||||
@property(nonatomic,copy) NSString *topic; // 消息话题
|
||||
|
||||
@property(nonatomic,copy) NSString *fromUid; // 发送者uid
|
||||
@property(nonatomic,copy) NSString *toUid; // 接收者uid
|
||||
|
||||
@property(nonatomic,strong,readonly) WKChannelMember *memberOfFrom; // 发送者在频道里的成员信息
|
||||
|
||||
@property(nonatomic,strong) WKChannel *channel; // 频道
|
||||
|
||||
@property(nonatomic,strong) WKChannel *parentChannel; // 父类频道
|
||||
|
||||
@property(nullable,nonatomic,strong,readonly) WKChannelInfo *channelInfo; // 频道资料,可能为空,如果为空可以调用WKChannelManager fetchChannelInfo:completion 触发频道信息变更委托
|
||||
@property(nonatomic,assign) NSInteger contentType; // 正文类型
|
||||
@property(nonatomic,strong) WKMessageContent *content; // 消息正文
|
||||
@property(nonatomic,strong) NSData *contentData; // 消息正文data数据
|
||||
@property(nonatomic,assign) BOOL voiceReaded; // 语音是否已读 (对语音消息有效)
|
||||
@property(nonatomic,assign) WKMessageStatus status; // 消息状态
|
||||
@property(nonatomic,assign) WKReason reasonCode; // 原因代码,当status为WK_MESSAGE_FAIL时 应该有相应的原因代号
|
||||
@property(nonatomic,weak,readonly) id<WKTaskProto> task; // 消息关联的任务(例如:下载图片任务,上传图片任务等等)
|
||||
|
||||
- (BOOL)isSend; // 是否是发送消息
|
||||
|
||||
@property(nonatomic,strong) NSMutableDictionary *extra; // 消息本地扩展数据
|
||||
@property(nonatomic,strong,nullable) NSArray<WKReaction*> *reactions; // 消息回应集合
|
||||
@property(nonatomic,assign) BOOL isDeleted; // 消息是否被删除
|
||||
|
||||
// ---------- 消息远程扩展 ----------
|
||||
@property(nonatomic,assign) BOOL hasRemoteExtra; // 是否有远程消息扩展(sdk内部用于插入消息扩展表的判断)
|
||||
|
||||
@property(nonatomic,assign) BOOL viewed; // 是否已查看 0.未查看 1.已查看 (这个字段跟已读的区别在于是真正的查看了消息内容,比如图片消息 已读是列表滑动到图片消息位置就算已读,viewed是表示点开图片才算已查看,语音消息类似)
|
||||
|
||||
@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; // 编辑内容是否需要上传
|
||||
|
||||
@end
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
201
ios/WuKongIMSDK.framework/Headers/WKMessageContent.h
Normal file
201
ios/WuKongIMSDK.framework/Headers/WKMessageContent.h
Normal file
@ -0,0 +1,201 @@
|
||||
//
|
||||
// WKMessageContent.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/29.
|
||||
//
|
||||
|
||||
|
||||
extern NSString * _Nonnull const WKEntityTypeRobotCommand; // robot命令
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKUserInfo.h"
|
||||
#import <fmdb/FMDB.h>
|
||||
@class WKMessageContent;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
/*!
|
||||
@提醒的类型
|
||||
*/
|
||||
typedef NS_ENUM(NSUInteger, WKMentionedType) {
|
||||
/*!
|
||||
@所有人
|
||||
*/
|
||||
WK_Mentioned_All = 1,
|
||||
|
||||
/*!
|
||||
@部分指定用户
|
||||
*/
|
||||
WK_Mentioned_Users = 2,
|
||||
};
|
||||
|
||||
@interface WKMessageEntity : NSObject
|
||||
@property(nonatomic,copy) NSString *type;
|
||||
@property(nonatomic,assign) NSRange range;
|
||||
@property(nonatomic,strong) id value;
|
||||
|
||||
+(WKMessageEntity*) type:(NSString*)type range:(NSRange)range;
|
||||
+(WKMessageEntity*) type:(NSString*)type range:(NSRange)range value:(id _Nullable)value;
|
||||
@end
|
||||
|
||||
/**
|
||||
消息中的@提醒信息
|
||||
*/
|
||||
@interface WKMentionedInfo : NSObject
|
||||
|
||||
|
||||
/// 初始化@提醒信息
|
||||
/// @param type <#type description#>
|
||||
- (instancetype)initWithMentionedType:(WKMentionedType)type;
|
||||
/*!
|
||||
初始化@提醒信息
|
||||
|
||||
@param type @提醒的类型
|
||||
@param uids @的用户ID列表
|
||||
|
||||
@return @提醒信息的对象
|
||||
*/
|
||||
- (instancetype)initWithMentionedType:(WKMentionedType)type
|
||||
uids:(NSArray *__nullable)uids;
|
||||
|
||||
|
||||
/*!
|
||||
@提醒的类型
|
||||
*/
|
||||
@property (nonatomic, assign) WKMentionedType type;
|
||||
|
||||
/*!
|
||||
@的用户ID列表
|
||||
|
||||
@discussion 如果type是@所有人,则可以传nil
|
||||
*/
|
||||
@property (nonatomic, strong) NSArray<NSString *> *uids;
|
||||
|
||||
/*!
|
||||
是否@了我
|
||||
*/
|
||||
@property (nonatomic, readonly) BOOL isMentionedMe;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
|
||||
/// 回复
|
||||
@interface WKReply : NSObject
|
||||
|
||||
@property(nonatomic,copy) NSString *messageID; // 被回复的消息ID
|
||||
@property(nonatomic,assign) uint32_t messageSeq; // 被回复的消息seq
|
||||
|
||||
@property(nonatomic,copy) NSString *fromUID; // 被回复消息的发送者
|
||||
@property(nonatomic,copy) NSString *fromName; // 被回复消息的发送者名称
|
||||
@property(nonatomic,copy) NSString *rootMessageID; // 根消息ID(可为空)
|
||||
@property(nonatomic,assign) BOOL revoke; // 是否被撤回
|
||||
|
||||
@property(nonatomic,strong) WKMessageContent *content; // 被回复的消息正文
|
||||
|
||||
@end
|
||||
|
||||
@class WKMessage;
|
||||
@interface WKMessageContent : NSObject<NSCopying>
|
||||
|
||||
//TODO: 这里要注意不能声明为strong 如果声明为strong message和media互相引用 就释放不掉了导致内存爆炸。
|
||||
@property(nonatomic,weak) WKMessage *message;
|
||||
|
||||
/**
|
||||
消息内容中携带的发送者的用户信息
|
||||
*/
|
||||
@property (nonatomic, strong) WKUserInfo *senderUserInfo;
|
||||
|
||||
/*!
|
||||
消息中的@提醒信息
|
||||
*/
|
||||
@property (nonatomic, strong) WKMentionedInfo *mentionedInfo;
|
||||
|
||||
|
||||
/// 回复内容
|
||||
@property(nonatomic,strong) WKReply *reply;
|
||||
|
||||
/*!
|
||||
将消息内容序列化,编码成为可传输的json数据
|
||||
|
||||
@discussion
|
||||
消息内容通过此方法,将消息中的所有数据,编码成为json数据,返回的json数据将用于网络传输。
|
||||
*/
|
||||
- (NSData *)encode;
|
||||
|
||||
// 上层无需实现encode 实现此方法即可
|
||||
-(NSDictionary*) encodeWithJSON;
|
||||
|
||||
// 上层无序实现decode 实现此方法即可
|
||||
-(void) decodeWithJSON:(NSDictionary*)contentDic;
|
||||
|
||||
/*!
|
||||
将json数据的内容反序列化,解码生成可用的消息内容
|
||||
|
||||
@param data 消息中的原始json数据
|
||||
|
||||
@discussion
|
||||
网络传输的json数据,会通过此方法解码,获取消息内容中的所有数据,生成有效的消息内容。
|
||||
*/
|
||||
- (void)decode:(NSData *)data;
|
||||
|
||||
// TODO: 解码消息只供DB使用(为了兼容MOS的@消息,因为@消息有DB操作 如果直接调用DB会与外面的DB发生冲突)
|
||||
- (void)decode:(NSData *)data db:(FMDatabase*)db;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
你自定义的消息类型,在各个平台上需要保持一致
|
||||
@return 正文类型
|
||||
*/
|
||||
+(NSInteger) contentType;
|
||||
|
||||
|
||||
/// 实际获取到的contentType (这种情况只会一个content对象被指定多个contentType的时候,可以通过这个属性获取到真实的contentType)
|
||||
@property(nonatomic,assign,readonly) NSInteger realContentType;
|
||||
|
||||
/*!
|
||||
返回可搜索的关键内容列表
|
||||
|
||||
@return 返回可搜索的关键内容列表
|
||||
|
||||
@discussion 这里返回的关键内容列表将用于消息搜索,自定义消息必须要实现此接口才能进行搜索。
|
||||
*/
|
||||
- (NSString *)searchableWord;
|
||||
|
||||
|
||||
/**
|
||||
返回在会话列表和本地通知中显示的消息内容摘要
|
||||
|
||||
@return <#return value description#>
|
||||
*/
|
||||
- (NSString *)conversationDigest;
|
||||
|
||||
|
||||
/// 消息正文字典
|
||||
@property(nonatomic,strong) NSDictionary *contentDict;
|
||||
|
||||
/**
|
||||
扩展字段
|
||||
*/
|
||||
@property(nonatomic,strong) NSMutableDictionary *extra;
|
||||
|
||||
|
||||
/// in 如果此字段有值 表示 只有在此值内的uid才能看见此条消息
|
||||
@property(nonatomic,strong) NSArray *visibles;
|
||||
|
||||
@property(nonatomic,copy,nullable) NSString *robotID; // 机器人编号,如果是机器人发的消息需要给到机器人的ID
|
||||
/// 消息entitiy项
|
||||
@property(nonatomic,strong) NSArray<WKMessageEntity*> *entities;
|
||||
|
||||
@property(nonatomic,assign) BOOL flame; // 是否开启阅后即焚
|
||||
@property(nonatomic,assign) NSInteger flameSecond; // 阅后即焚的秒数,如果为0 表示读后就删,如果有值表示读后多少秒后删
|
||||
|
||||
// 用户滑动看见消息就认为已查看 默认为true
|
||||
-(BOOL) viewedOfVisible;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
294
ios/WuKongIMSDK.framework/Headers/WKMessageDB.h
Normal file
294
ios/WuKongIMSDK.framework/Headers/WKMessageDB.h
Normal file
@ -0,0 +1,294 @@
|
||||
//
|
||||
// WKMessageDB.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/29.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessage.h"
|
||||
#import "WKSendackPacket.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKMessageDB : NSObject
|
||||
|
||||
+ (WKMessageDB *)shared;
|
||||
/**
|
||||
保存消息
|
||||
|
||||
@param messages 消息集合
|
||||
@return 返回去重了的消息集合
|
||||
*/
|
||||
-(NSArray<WKMessage*>*) saveMessages:(NSArray<WKMessage*>*)messages;
|
||||
|
||||
|
||||
/// 保存或更新消息
|
||||
/// @param messages <#messages description#>
|
||||
-(NSArray<WKMessage*>*) replaceMessages:(NSArray<WKMessage*>*)messages;
|
||||
|
||||
|
||||
/**
|
||||
获取频道中,从指定消息之前、指定数量的最新消息实体
|
||||
|
||||
@param channel 频道
|
||||
@param oldestOrderSeq 截止的客户端排序号
|
||||
@param limit 消息数量限制
|
||||
@return 消息实体集合
|
||||
|
||||
例如: oldestOrderSeq为20,count为2,会返回oldestOrderSeq为19和18的WKMessage对象列表。
|
||||
*/
|
||||
//-(NSArray<WKMessage*>*) getMessages:(WKChannel*)channel oldestOrderSeq:(uint32_t)oldestOrderSeq limit:(int) limit;
|
||||
//
|
||||
|
||||
/// 获取频道中,从指定消息之前、指定数量的最新消息实体
|
||||
/// @param channel 查询指定频道
|
||||
/// @param startOrderSeq 开始orderSeq
|
||||
/// @param endOrderSeq 结束排序seq
|
||||
/// @param limit 限制
|
||||
/// @param pullMode 拉取模式
|
||||
-(NSArray<WKMessage*>*) getMessages:(WKChannel*)channel startOrderSeq:(uint32_t)startOrderSeq endOrderSeq:(uint32_t)endOrderSeq limit:(int) limit pullMode:(WKPullMode)pullMode;
|
||||
|
||||
|
||||
/// 获取消息列表
|
||||
/// @param channel 频道对象
|
||||
/// @param keyword 关键字
|
||||
-(NSArray<WKMessage*>*) getMessages:(WKChannel*)channel keyword:(NSString*)keyword limit:(int) limit;
|
||||
|
||||
/// 获取消息
|
||||
/// @param messageSeq 偏移的messageSeq
|
||||
/// @param limit 数据限制
|
||||
-(NSArray<WKMessage*>*) getMessages:(uint32_t)messageSeq limit:(int)limit;
|
||||
|
||||
|
||||
-(NSArray<WKMessage*>*) getDeletedMessagesWithChannel:(WKChannel*)channel minMessageSeq:(uint32_t)minMessageSeq maxMessageSeq:(uint32_t)maxMessageSeq;
|
||||
|
||||
|
||||
/// 获取消息序号区间内已经被删除的消息的messageSeq
|
||||
/// @param channel 频道
|
||||
/// @param minMessageSeq 最小消息序号
|
||||
/// @param maxMessageSeq 最大消息序号
|
||||
-(NSArray<NSNumber*>*) getDeletedMessageSeqWithChannel:(WKChannel*)channel minMessageSeq:(uint32_t)minMessageSeq maxMessageSeq:(uint32_t)maxMessageSeq;
|
||||
|
||||
/// 获取比messageSeq小并且已删除了的序号
|
||||
/// @param channel 频道
|
||||
/// @param messageSeq 消息序号
|
||||
/// @param limit 最大数量
|
||||
-(NSArray<NSNumber*>*) getDeletedLessThanMessageSeqWithChannel:(WKChannel*)channel messageSeq:(uint32_t)messageSeq limit:(int)limit;
|
||||
|
||||
/// 获取比messageSeq大并且已删除了的序号
|
||||
/// @param channel 频道
|
||||
/// @param messageSeq 消息序号
|
||||
/// @param limit 最大数量
|
||||
-(NSArray<NSNumber*>*) getDeletedMoreThanMessageSeqWithChannel:(WKChannel*)channel messageSeq:(uint32_t)messageSeq limit:(int)limit;
|
||||
|
||||
/**
|
||||
通过序列号获取消息
|
||||
|
||||
@param clientSeqs <#clientSeqs description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(NSArray<WKMessage*>*) getMessagesWithClientSeqs:(NSArray<NSNumber*>*)clientSeqs;
|
||||
|
||||
|
||||
/// 通过客户端消息编号获取消息列表
|
||||
/// @param clientMsgNos <#clientMsgNos description#>
|
||||
-(NSArray<WKMessage*>*) getMessagesWithClientMsgNos:(NSArray*)clientMsgNos;
|
||||
|
||||
/**
|
||||
通过消息id集合获取消息
|
||||
*/
|
||||
-(NSArray<WKMessage*>*) getMessagesWithMessageIDs:(NSArray<NSNumber*>*)messageIDs;
|
||||
|
||||
/**
|
||||
通过客户端消息编号获取消息
|
||||
|
||||
@param clientMsgNo 客户端消息编号
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKMessage*) getMessageWithClientMsgNo:(NSString*)clientMsgNo;
|
||||
/**
|
||||
获取指定clientSeq的消息
|
||||
|
||||
@param clientSeq 客户端序号
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKMessage*) getMessage:(uint32_t)clientSeq;
|
||||
|
||||
|
||||
/// 通过消息序号查询消息
|
||||
/// @param channel <#channel description#>
|
||||
/// @param messageSeq <#messageSeq description#>
|
||||
-(WKMessage*) getMessage:(WKChannel*)channel messageSeq:(uint32_t)messageSeq;
|
||||
|
||||
|
||||
|
||||
/// 通过排序号获取频道内指定消息
|
||||
/// @param orderSeq <#orderSeq description#>
|
||||
/// @param channel <#channel description#>
|
||||
-(WKMessage*) getMessage:(WKChannel*)channel orderSeq:(uint32_t)orderSeq;
|
||||
|
||||
|
||||
/// 获取小于指定orderSeq 有messageSeq的第一条消息
|
||||
/// @param channel <#channel description#>
|
||||
/// @param orderSeq <#orderSeq description#>
|
||||
-(WKMessage*) getMessage:(WKChannel*)channel lessThanAndFirstMessageSeq:(uint32_t)orderSeq;
|
||||
|
||||
// 获取大于指定orderSeq 有messageSeq的第一条消息
|
||||
-(WKMessage*) getMessage:(WKChannel*)channel moreThanAndFirstMessageSeq:(uint32_t)orderSeq;
|
||||
/**
|
||||
通过消息ID获取消息
|
||||
|
||||
@param messageId <#messageId description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKMessage*) getMessageWithMessageId:(uint64_t)messageId;
|
||||
|
||||
/**
|
||||
更新消息通过发送回执消息
|
||||
|
||||
@param sendackPackets <#sendackPackets description#>
|
||||
*/
|
||||
-(void) updateMessageWithSendackPackets:(NSArray<WKSendackPacket*> *)sendackPackets;
|
||||
|
||||
|
||||
/**
|
||||
更新消息
|
||||
|
||||
@param content 消息content内容
|
||||
@param status 消息状态
|
||||
@param extra 消息扩展数据
|
||||
@param clientSeq 消息客户端唯一编号
|
||||
*/
|
||||
-(void) updateMessageContent:(NSData*)content status:(WKMessageStatus)status extra:(NSDictionary*)extra clientSeq:(uint32_t)clientSeq;
|
||||
|
||||
|
||||
/**
|
||||
更新语音消息已读状态
|
||||
|
||||
@param voiceReaded 语音是否已读
|
||||
@param clientSeq 客户端唯一ID
|
||||
*/
|
||||
-(void) updateMessageVoiceReaded:(BOOL)voiceReaded clientSeq:(uint32_t)clientSeq;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
更新消息扩展字段
|
||||
|
||||
@param extra <#extra description#>
|
||||
@param clientSeq <#clientSeq description#>
|
||||
*/
|
||||
-(void) updateMessageExtra:(NSDictionary*) extra clientSeq:(uint32_t)clientSeq;
|
||||
/**
|
||||
将上传中的消息状态更改为发送失败的状态
|
||||
*/
|
||||
-(void) updateMessageUploadingToFailStatus;
|
||||
|
||||
|
||||
/// 获取所有等待发送的消息
|
||||
-(NSArray<WKMessage*>*) getMessagesWaitSend;
|
||||
/**
|
||||
更新消息状态
|
||||
|
||||
@param status 消息状态
|
||||
@param clientSeq 消息clientSeq
|
||||
*/
|
||||
-(void) updateMessageStatus:(WKMessageStatus)status withClientSeq:(uint32_t)clientSeq;
|
||||
|
||||
|
||||
/// 更新消息撤回状态
|
||||
/// @param revoke <#revoke description#>
|
||||
/// @param clientMsgNo <#clientMsgNo description#>
|
||||
-(void) updateMessageRevoke:(BOOL)revoke clientMsgNo:(NSString*)clientMsgNo;
|
||||
|
||||
/**
|
||||
获取某个频道消息表中最大的message_seq
|
||||
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(uint32_t) getMaxMessageSeq:(WKChannel*)channel;
|
||||
|
||||
|
||||
/**
|
||||
删除消息
|
||||
|
||||
@param message 消息对象
|
||||
*/
|
||||
-(void) deleteMessage:(WKMessage*)message;
|
||||
|
||||
|
||||
/**
|
||||
彻底将消息从数据库删除 (deleteMessage只是标记为删除)
|
||||
*/
|
||||
- (void)destoryMessage:(WKMessage *)message;
|
||||
|
||||
/**
|
||||
获取指定频道内指定发送者的消息集合
|
||||
*/
|
||||
-(NSArray<WKMessage*>*) getMessages:(NSString*)fromUID channel:(WKChannel*)channel;
|
||||
|
||||
|
||||
/**
|
||||
清除指定频道的消息
|
||||
|
||||
@param channel 频道
|
||||
*/
|
||||
-(void) clearMessages:(WKChannel*)channel;
|
||||
|
||||
|
||||
/// 清除所有消息
|
||||
-(void) clearAllMessages;
|
||||
|
||||
/// 清除指定maxMsgSeq以前的所有消息
|
||||
/// @param channel 频道
|
||||
/// @param maxMsgSeq 指定的messageSeq
|
||||
/// @param isContain 清除的消息是否包含指定的maxMsgSeq
|
||||
- (void) clearFromMsgSeq:(WKChannel*)channel maxMsgSeq:(uint32_t)maxMsgSeq isContain:(BOOL)isContain;
|
||||
/**
|
||||
获取最后一条消息
|
||||
|
||||
@param channel <#channel description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKMessage*) getLastMessage:(WKChannel*)channel;
|
||||
|
||||
|
||||
/// 获取指定偏移量的最新消息
|
||||
/// @param channel <#channel description#>
|
||||
/// @param offset <#offset description#>
|
||||
-(WKMessage*) getLastMessage:(WKChannel*)channel offset:(NSInteger)offset;
|
||||
|
||||
|
||||
/// 查询排序在指定message之前的消息数量
|
||||
/// @param message <#message description#>
|
||||
-(NSInteger) getOrderCountMoreThanMessage:(WKMessage*)message;
|
||||
|
||||
/**
|
||||
获取指定频道的最大扩展版本
|
||||
*/
|
||||
-(long long) getMessageExtraMaxVersion:(WKChannel*)channel;
|
||||
|
||||
/**
|
||||
获取需要焚烧的消息(阅后即焚)
|
||||
*/
|
||||
-(NSArray<WKMessage*>*) getMessagesOfNeedFlame;
|
||||
|
||||
/**
|
||||
获取消息最大ID
|
||||
*/
|
||||
-(long long) getMessageMaxID;
|
||||
|
||||
/// 更新消息为已查看
|
||||
-(NSArray<WKMessage*>*) updateViewed:(NSArray<WKMessage*>*)messages;
|
||||
|
||||
/**
|
||||
获取指定messageSeq的周围第一条消息的messageSeq 0表示没有
|
||||
*/
|
||||
-(uint32_t) getChannelAroundFirstMessageSeq:(WKChannel*)channel messageSeq:(uint32_t)messageSeq;
|
||||
|
||||
-(WKMessageContent*) decodeContent:(NSInteger)contentType data:(NSData *)contentData db:(FMDatabase*)db;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
41
ios/WuKongIMSDK.framework/Headers/WKMessageExtra.h
Normal file
41
ios/WuKongIMSDK.framework/Headers/WKMessageExtra.h
Normal file
@ -0,0 +1,41 @@
|
||||
//
|
||||
// WKMessageExtra.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2022/4/12.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessageContent.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKContentEditUploadStatusSuccess, // 成功
|
||||
WKContentEditUploadStatusWait, // 等待上传
|
||||
WKContentEditUploadStatusError, // 上传错误
|
||||
} WKContentEditUploadStatus; // 编辑正文上传状态
|
||||
|
||||
@interface WKMessageExtra : NSObject
|
||||
|
||||
@property(nonatomic,assign) uint64_t messageID; // 消息id
|
||||
@property(nonatomic,copy) NSString *channelID; // 频道id
|
||||
@property(nonatomic,assign) NSInteger channelType; // 频道类型
|
||||
@property(nonatomic,assign) uint32_t messageSeq; // 消息id
|
||||
@property(nonatomic,assign) BOOL readed; // 是否已读
|
||||
@property(nonatomic,copy) NSDate *readedAt; // 已读时间
|
||||
@property(nonatomic,assign) NSInteger readedCount; // 已读人数
|
||||
@property(nonatomic,assign) NSInteger unreadCount; // 未读人数
|
||||
@property(nonatomic,assign) BOOL revoke; // 是否撤回
|
||||
@property(nonatomic,copy) NSString *revoker; // 撤回人的uid
|
||||
@property(nonatomic,assign) int64_t extraVersion;
|
||||
@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) WKContentEditUploadStatus uploadStatus; // 上传状态
|
||||
|
||||
@property(nonatomic,copy) NSDictionary *extra; // 扩展数据
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
42
ios/WuKongIMSDK.framework/Headers/WKMessageExtraDB.h
Normal file
42
ios/WuKongIMSDK.framework/Headers/WKMessageExtraDB.h
Normal file
@ -0,0 +1,42 @@
|
||||
//
|
||||
// WKMessageExtraDB.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2022/4/12.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessageExtra.h"
|
||||
#import "WKChannel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKMessageExtraDB : NSObject
|
||||
|
||||
+ (WKMessageExtraDB *)shared;
|
||||
|
||||
|
||||
-(void) addOrUpdateMessageExtras:(NSArray<WKMessageExtra*>*)messageExtras;
|
||||
|
||||
-(void) addOrUpdateMessageExtra:(WKMessageExtra*)messageExtra db:(FMDatabase*)db;
|
||||
|
||||
|
||||
-(long long) getMessageExtraMaxVersion:(WKChannel*)channel;
|
||||
|
||||
// 添加或更新正文编辑的内容
|
||||
-(void) addOrUpdateContentEdit:(WKMessageExtra*)messageExtra;
|
||||
|
||||
// 通过消息ID获取消息扩展
|
||||
-(WKMessageExtra*) getMessageExtraWithMessageID:(uint64_t)messageID;
|
||||
|
||||
// 获取等待上传的正文编辑内容
|
||||
-(NSArray<WKMessageExtra*>*) getContentEditWaitUpload;
|
||||
|
||||
// 更新正文上传状态为失败
|
||||
-(void) updateContentEditUploadStatusToFailStatus;
|
||||
|
||||
// 更新消息状态
|
||||
-(void) updateUploadStatus:(WKContentEditUploadStatus)status withMessageID:(uint64_t)messageID;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,25 @@
|
||||
//
|
||||
// WKMessageFileDownloadTask.h
|
||||
// WuKongIMBase
|
||||
//
|
||||
// Created by tt on 2020/1/16.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKBaseTask.h"
|
||||
#import "WKMessage.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKMessageFileDownloadTask : WKBaseTask
|
||||
-(instancetype) initWithMessage:(WKMessage*)message;
|
||||
|
||||
|
||||
// 消息
|
||||
@property(nonatomic,strong) WKMessage *message;
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
32
ios/WuKongIMSDK.framework/Headers/WKMessageFileUploadTask.h
Normal file
32
ios/WuKongIMSDK.framework/Headers/WKMessageFileUploadTask.h
Normal file
@ -0,0 +1,32 @@
|
||||
//
|
||||
// WKMessageFileUploadTask.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/15.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKTaskProto.h"
|
||||
#import "WKMessage.h"
|
||||
#import "WKBaseTask.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKMessageFileUploadTask : WKBaseTask
|
||||
|
||||
-(instancetype) initWithMessage:(WKMessage*)message;
|
||||
|
||||
// 消息
|
||||
@property(nonatomic,strong) WKMessage *message;
|
||||
|
||||
|
||||
/**
|
||||
上传后返回的路径
|
||||
*/
|
||||
@property(nullable,nonatomic,strong) NSString *remoteUrl;
|
||||
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
21
ios/WuKongIMSDK.framework/Headers/WKMessageStatusModel.h
Normal file
21
ios/WuKongIMSDK.framework/Headers/WKMessageStatusModel.h
Normal file
@ -0,0 +1,21 @@
|
||||
//
|
||||
// WKMessageStatusModel.h
|
||||
// WuKongIMBase
|
||||
//
|
||||
// Created by tt on 2019/12/29.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKConst.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKMessageStatusModel : NSObject
|
||||
// 消息唯一ID
|
||||
@property(nonatomic,assign) uint32_t clientSeq;
|
||||
// 消息状态
|
||||
@property(nonatomic) WKMessageStatus status;
|
||||
|
||||
-(instancetype) initWithClientSeq:(uint32_t)clientSeq status:(WKMessageStatus)status;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,27 @@
|
||||
//
|
||||
// WKMultiMediaMessageContent.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/13.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessageContent.h"
|
||||
#import "WKMediaProto.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
如果一个消息有多个多媒体文件 使用此MessageContent
|
||||
*/
|
||||
@interface WKMultiMediaMessageContent : WKMessageContent
|
||||
|
||||
|
||||
/**
|
||||
多个多媒体文件
|
||||
*/
|
||||
@property NSArray<id<WKMediaProto>> *medias;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
22
ios/WuKongIMSDK.framework/Headers/WKNOGeneraterUtil.h
Normal file
22
ios/WuKongIMSDK.framework/Headers/WKNOGeneraterUtil.h
Normal file
@ -0,0 +1,22 @@
|
||||
//
|
||||
// WKNOGeneraterUtil.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/6/1.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* 为一段data创建唯一的64位数据签名
|
||||
*
|
||||
* @param[in] psrc src data
|
||||
* @param[in] slen data的长度
|
||||
* @return 操作结果
|
||||
* - 1 成功
|
||||
* - -1 失败
|
||||
* @note 异常情况:
|
||||
* - if slen<0,有可能出现程序异常;
|
||||
* - if slen==0,sign = 0:0;
|
||||
*/
|
||||
uint64_t get_sign64 (const char* psrc, int slen);
|
143
ios/WuKongIMSDK.framework/Headers/WKOptions.h
Normal file
143
ios/WuKongIMSDK.framework/Headers/WKOptions.h
Normal file
@ -0,0 +1,143 @@
|
||||
//
|
||||
// WKOptions.h
|
||||
// CocoaAsyncSocket
|
||||
//
|
||||
// Created by tt on 2019/11/23.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKConnectInfo.h"
|
||||
#import "WKConst.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKModeWrite, // 写扩散模式
|
||||
WKModeRead, // 读扩散模式
|
||||
} WKMode;
|
||||
|
||||
|
||||
typedef WKConnectInfo*_Nonnull(^WKConnectInfoCallback)(void);
|
||||
|
||||
|
||||
@interface WKOptions : NSObject
|
||||
|
||||
|
||||
/**
|
||||
IM的host
|
||||
*/
|
||||
@property(nonatomic,copy) NSString *host;
|
||||
|
||||
/**
|
||||
IM的端口
|
||||
*/
|
||||
@property(nonatomic,assign) uint16_t port;
|
||||
|
||||
|
||||
/// IM模式
|
||||
@property(nonatomic,assign) WKMode mode;
|
||||
/**
|
||||
连接信息回调
|
||||
*/
|
||||
@property(nonatomic,copy) WKConnectInfoCallback connectInfoCallback;
|
||||
|
||||
|
||||
/**
|
||||
连接信息
|
||||
*/
|
||||
@property(nullable,nonatomic,strong) WKConnectInfo *connectInfo;
|
||||
/**
|
||||
是否是debug模式
|
||||
*/
|
||||
@property(nonatomic,assign) bool isDebug;
|
||||
|
||||
|
||||
/**
|
||||
是否有登录信息
|
||||
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(BOOL) hasLogin;
|
||||
|
||||
/**
|
||||
心跳间隔 ( 单位秒)
|
||||
*/
|
||||
@property(nonatomic,assign) NSTimeInterval heartbeatInterval;
|
||||
|
||||
/**
|
||||
数据库的存储目录
|
||||
*/
|
||||
@property(nonatomic,copy) NSString *dbDir;
|
||||
|
||||
|
||||
/// db前缀
|
||||
@property(nonatomic,copy) NSString *dbPrefix;
|
||||
|
||||
// 消息文件根目录
|
||||
@property(nonatomic,copy) NSString *messageFileRootDir;
|
||||
|
||||
|
||||
/**
|
||||
在每次发送消息中是否携带发送者的用户信息。
|
||||
*/
|
||||
@property(nonatomic,assign) bool enableMessageAttachUserInfo;
|
||||
|
||||
/**
|
||||
消息重试间隔 (单位秒)
|
||||
*/
|
||||
@property(nonatomic,assign) NSTimeInterval messageRetryInterval;
|
||||
// 编辑后的消息正文上传重试间隔 (单位秒)
|
||||
@property(nonatomic,assign) NSTimeInterval contentEditRetryInterval;
|
||||
|
||||
// reminder已done的数据上传过期时间(超过这个时间将设置为上传失败) (单位秒)
|
||||
@property(nonatomic,assign) NSTimeInterval reminderDoneUploadExpire;
|
||||
|
||||
@property(nonatomic,assign) NSTimeInterval reminderRetryInterval; // 提醒项重试间隔
|
||||
@property(nonatomic,assign) NSInteger reminderRetryCount; // 提醒项重试次数
|
||||
|
||||
/**
|
||||
消息重试次数
|
||||
*/
|
||||
@property(nonatomic,assign) NSInteger messageRetryCount;
|
||||
|
||||
// 消息正文重试次数
|
||||
@property(nonatomic,assign) NSInteger contentEditRetryCount;
|
||||
|
||||
/**
|
||||
已读回执flush到服务器的间隔
|
||||
*/
|
||||
@property(nonatomic,assign) NSTimeInterval receiptFlushInterval;
|
||||
|
||||
/**
|
||||
离线消息每次拉取数量
|
||||
*/
|
||||
@property(nonatomic,assign) NSInteger offlineMessageLimit;
|
||||
|
||||
|
||||
/// 发送图片的时候图片最大大小,大于这个大小将自动压缩
|
||||
@property(nonatomic,assign) long imageMaxBytes;
|
||||
|
||||
|
||||
/// SDK使用消息协议版本(默认使用最新的协议,如果使用旧协议需要手动设置值)
|
||||
@property(nonatomic,assign) uint8_t protoVersion;
|
||||
|
||||
|
||||
|
||||
/// 同步频道消息每次大小
|
||||
@property(nonatomic,assign) NSInteger syncChannelMessageLimit;
|
||||
|
||||
/// 协议类型
|
||||
@property(nonatomic,assign) WKProto proto;
|
||||
|
||||
@property(nonatomic,assign) BOOL mosConvertOn; // 是否开启mos的content转换(临时参数)
|
||||
|
||||
@property(nonatomic,assign) NSInteger messageExtraSyncLimit; // 同步扩展消息每次数量限制
|
||||
|
||||
@property(nonatomic,assign) NSInteger channelRequestMaxLimit; // 同时发起请求频道数据的最大数量
|
||||
|
||||
// 是否追踪db日志
|
||||
@property(nonatomic,assign) BOOL traceDBLog;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
17
ios/WuKongIMSDK.framework/Headers/WKPacket.h
Normal file
17
ios/WuKongIMSDK.framework/Headers/WKPacket.h
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// WKPacket.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/25.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKHeader.h"
|
||||
typedef NSString* (^Encode)(void);
|
||||
|
||||
@interface WKPacket : NSObject
|
||||
|
||||
@property(nonatomic,strong) WKHeader *header;
|
||||
|
||||
|
||||
@end
|
15
ios/WuKongIMSDK.framework/Headers/WKPacketBodyCoder.h
Normal file
15
ios/WuKongIMSDK.framework/Headers/WKPacketBodyCoder.h
Normal file
@ -0,0 +1,15 @@
|
||||
//
|
||||
// WKPacketBodyCoder.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/25.
|
||||
//
|
||||
#import "WKPacket.h"
|
||||
|
||||
@protocol WKPacketBodyCoder <NSObject>
|
||||
|
||||
-(WKPacket*) decode:(NSData*) body header:(WKHeader*)header;
|
||||
|
||||
-(NSData*) encode:(WKPacket*)packet;
|
||||
|
||||
@end
|
33
ios/WuKongIMSDK.framework/Headers/WKPakcetBodyCoderManager.h
Normal file
33
ios/WuKongIMSDK.framework/Headers/WKPakcetBodyCoderManager.h
Normal file
@ -0,0 +1,33 @@
|
||||
//
|
||||
// WKPakcetBodyManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/25.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacketBodyCoder.h"
|
||||
#import "WKConst.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKPakcetBodyCoderManager : NSObject
|
||||
|
||||
|
||||
/**
|
||||
注册body解码者
|
||||
|
||||
@param packetType 包类型
|
||||
@param bodyCoder 包编码者
|
||||
*/
|
||||
-(void) registerBodyCoder:(WKPacketType)packetType bodyCoder:(id<WKPacketBodyCoder>)bodyCoder;
|
||||
|
||||
/**
|
||||
获取body编码者
|
||||
|
||||
@param packetType 包类型
|
||||
@return 返回包body编码者
|
||||
*/
|
||||
-(id<WKPacketBodyCoder>) getBodyCoder:(WKPacketType)packetType;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
17
ios/WuKongIMSDK.framework/Headers/WKPingPacket.h
Normal file
17
ios/WuKongIMSDK.framework/Headers/WKPingPacket.h
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// WKPingPacket.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
#import "WKPacketBodyCoder.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKPingPacket : WKPacket<WKPacketBodyCoder>
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
17
ios/WuKongIMSDK.framework/Headers/WKPongPacket.h
Normal file
17
ios/WuKongIMSDK.framework/Headers/WKPongPacket.h
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// WKPongPacket.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
#import "WKPacketBodyCoder.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKPongPacket : WKPacket<WKPacketBodyCoder>
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
48
ios/WuKongIMSDK.framework/Headers/WKRSAUtil.h
Normal file
48
ios/WuKongIMSDK.framework/Headers/WKRSAUtil.h
Normal file
@ -0,0 +1,48 @@
|
||||
//
|
||||
// WKRSAUtil.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/9/16.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKRSAUtil : NSObject
|
||||
/**
|
||||
* -------RSA 字符串公钥加密-------
|
||||
@param plaintext 明文,待加密的字符串
|
||||
@param pubKey 公钥字符串
|
||||
@return 密文,加密后的字符串
|
||||
*/
|
||||
+ (NSString *)encrypt:(NSString *)plaintext PublicKey:(NSString *)pubKey;
|
||||
|
||||
/**
|
||||
* -------RSA 公钥文件加密-------
|
||||
@param plaintext 明文,待加密的字符串
|
||||
@param path 公钥文件路径,p12或pem格式
|
||||
@return 密文,加密后的字符串
|
||||
*/
|
||||
+ (NSString *)encrypt:(NSString *)plaintext KeyFilePath:(NSString *)path;
|
||||
|
||||
/**
|
||||
* -------RSA 私钥字符串解密-------
|
||||
@param ciphertext 密文,需要解密的字符串
|
||||
@param privKey 私钥字符串
|
||||
@return 明文,解密后的字符串
|
||||
*/
|
||||
+ (NSString *)decrypt:(NSString *)ciphertext PrivateKey:(NSString *)privKey;
|
||||
|
||||
/**
|
||||
* -------RSA 私钥文件解密-------
|
||||
@param ciphertext 密文,需要解密的字符串
|
||||
@param path 私钥文件路径,p12或pem格式(pem私钥需为pcks8格式)
|
||||
@param pwd 私钥文件的密码
|
||||
@return 明文,解密后的字符串
|
||||
*/
|
||||
+ (NSString *)decrypt:(NSString *)ciphertext KeyFilePath:(NSString *)path FilePwd:(NSString *)pwd;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
32
ios/WuKongIMSDK.framework/Headers/WKReaction.h
Normal file
32
ios/WuKongIMSDK.framework/Headers/WKReaction.h
Normal file
@ -0,0 +1,32 @@
|
||||
//
|
||||
// WKReaction.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/9/13.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKReaction : NSObject
|
||||
|
||||
@property(nonatomic,strong) WKChannel *channel;
|
||||
|
||||
// 消息ID(全局唯一)
|
||||
@property(nonatomic,assign) uint64_t messageId;
|
||||
// 回应uid
|
||||
@property(nonatomic,copy) NSString *uid;
|
||||
|
||||
// 回应的emoji
|
||||
@property(nonatomic,copy) NSString *emoji;
|
||||
|
||||
@property(nonatomic,assign) uint64_t version;
|
||||
|
||||
// 回应时间
|
||||
@property(nonatomic,copy) NSString *createdAt;
|
||||
|
||||
@property(nonatomic,assign) NSInteger isDeleted;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
44
ios/WuKongIMSDK.framework/Headers/WKReactionDB.h
Normal file
44
ios/WuKongIMSDK.framework/Headers/WKReactionDB.h
Normal file
@ -0,0 +1,44 @@
|
||||
//
|
||||
// WKReactionDB.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/9/13.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <fmdb/FMDB.h>
|
||||
#import "WKReaction.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKReactionDB : NSObject
|
||||
|
||||
+ (WKReactionDB *)shared;
|
||||
|
||||
|
||||
/**
|
||||
获取某个消息的回应
|
||||
*/
|
||||
-(NSArray<WKReaction*>*) getReactions:(NSArray<NSNumber*>*) messageIDs;
|
||||
|
||||
/**
|
||||
获取以消息ID为key 回应集合为值的字典
|
||||
*/
|
||||
-( NSDictionary<NSString*,NSArray<WKReaction*>*> *) getReactionDictionary:(NSArray<NSNumber*>*) messageIDs;
|
||||
|
||||
|
||||
/**
|
||||
插入回应
|
||||
*/
|
||||
-(BOOL) insertOrUpdateReactions:(NSArray<WKReaction*>*)reactions;
|
||||
|
||||
-(BOOL) insertOrUpdateReactions:(NSArray<WKReaction*>*)reactions db:(FMDatabase*)db;
|
||||
|
||||
/**
|
||||
获取某个频道的最大版本号
|
||||
*/
|
||||
-(uint64_t) maxVersion:(WKChannel*) channel;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
67
ios/WuKongIMSDK.framework/Headers/WKReactionManager.h
Normal file
67
ios/WuKongIMSDK.framework/Headers/WKReactionManager.h
Normal file
@ -0,0 +1,67 @@
|
||||
//
|
||||
// WKReactionManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/9/13.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
#import "WKReaction.h"
|
||||
@class WKReactionManager;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
typedef void(^WKSyncReactionsCallback)(NSArray<WKReaction*> * __nullable reactions,NSError * __nullable error);
|
||||
typedef void(^WKAddOrCancelReactionsCallback)(NSError * __nullable error);
|
||||
|
||||
@protocol WKReactionManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
// reaction改变
|
||||
-(void) reactionManagerChange:(WKReactionManager*)reactionManager reactions:(NSArray<WKReaction*>*)reactions channel:(WKChannel*)channel;
|
||||
|
||||
@end
|
||||
|
||||
@interface WKReactionManager : NSObject
|
||||
|
||||
+ (WKReactionManager *)shared;
|
||||
|
||||
/**
|
||||
添加或取消回应,如果同一个用户存在reactionName的回应则取消回应
|
||||
@param reactionName 回应的名称,一般是emoji或本地emoji图片的名称
|
||||
@param messageID 回应消息的ID
|
||||
@param complete 结果回掉
|
||||
*/
|
||||
|
||||
-(void) addOrCancelReaction:(NSString*)reactionName messageID:(uint64_t)messageID complete:(void(^_Nullable)(NSError * _Nullable error))complete;
|
||||
|
||||
/**
|
||||
添加连接委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void) addDelegate:(id<WKReactionManagerDelegate>) delegate;
|
||||
|
||||
|
||||
/**
|
||||
移除连接委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void)removeDelegate:(id<WKReactionManagerDelegate>) delegate;
|
||||
|
||||
|
||||
-(void) sync:(WKChannel*)channel;
|
||||
|
||||
// 同步点赞数据提供者
|
||||
@property(nonatomic,copy) void(^syncReactionsProvider)(WKChannel *channel,uint64_t maxVersion,WKSyncReactionsCallback callback);
|
||||
|
||||
// 添加或取消点赞数据提供者
|
||||
@property(nonatomic,copy) void(^addOrCancelReactionProvider)(WKChannel*channel,uint64_t messageID, NSString *reactionName,WKAddOrCancelReactionsCallback callback);
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
37
ios/WuKongIMSDK.framework/Headers/WKReceiptManager.h
Normal file
37
ios/WuKongIMSDK.framework/Headers/WKReceiptManager.h
Normal file
@ -0,0 +1,37 @@
|
||||
//
|
||||
// WKReceiptManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/4/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessage.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// 消息已读
|
||||
typedef void(^WKMessageReadedCallback)(NSError * __nullable error);
|
||||
typedef void(^WKMessageReadedProvider)(WKChannel *channel,NSArray<WKMessage*>*messages,WKMessageReadedCallback callback);
|
||||
|
||||
@interface WKReceiptManager : NSObject
|
||||
|
||||
+ (WKReceiptManager *)shared;
|
||||
|
||||
/**
|
||||
添加需要已读回执的消息
|
||||
*/
|
||||
-(void) addReceiptMessages:(WKChannel*)channel messages:(NSArray<WKMessage*>*)messages;
|
||||
|
||||
|
||||
/**
|
||||
flush到服务器
|
||||
*/
|
||||
//-(void) flush:(WKChannel*)channel complete:(void(^)(NSError *error))complete;
|
||||
|
||||
// 消息已读提供者
|
||||
@property(nonatomic,copy) WKMessageReadedProvider messageReadedProvider;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
38
ios/WuKongIMSDK.framework/Headers/WKRecvPacket.h
Normal file
38
ios/WuKongIMSDK.framework/Headers/WKRecvPacket.h
Normal file
@ -0,0 +1,38 @@
|
||||
//
|
||||
// WKRecvPacket.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
#import "WKPacketBodyCoder.h"
|
||||
#import "WKSetting.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKRecvPacket : WKPacket<WKPacketBodyCoder>
|
||||
|
||||
// 消息设置
|
||||
@property(nonatomic,strong) WKSetting *setting;
|
||||
// 消息唯一ID
|
||||
@property(nonatomic,assign) uint64_t messageId;
|
||||
// 消息序列号 (用户唯一,有序递增)
|
||||
@property(nonatomic,assign) uint32_t messageSeq;
|
||||
// 客户端消息唯一编号(用于消息去重)
|
||||
@property(nonatomic,copy) NSString *clientMsgNo;
|
||||
// 服务器时间
|
||||
@property(nonatomic,assign) uint32_t timestamp;
|
||||
// 发送者UID
|
||||
@property(nonatomic,copy) NSString *fromUid;
|
||||
//频道ID(如果是个人频道ChannelId为个人的UID)
|
||||
@property(nonatomic,copy) NSString *channelId;
|
||||
//频道类型(1.个人 2.群组)
|
||||
@property(nonatomic,assign) uint8_t channelType;
|
||||
// 话题
|
||||
@property(nonatomic,copy) NSString *topic;
|
||||
// 负荷数据
|
||||
@property(nonatomic,strong) NSData *payload;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
20
ios/WuKongIMSDK.framework/Headers/WKRecvackPacket.h
Normal file
20
ios/WuKongIMSDK.framework/Headers/WKRecvackPacket.h
Normal file
@ -0,0 +1,20 @@
|
||||
//
|
||||
// WKRecvackPacket.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/30.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
#import "WKPacketBodyCoder.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKRecvackPacket : WKPacket<WKPacketBodyCoder>
|
||||
|
||||
@property(nonatomic,assign) uint64_t messageId;
|
||||
@property(nonatomic,assign) uint32_t messageSeq;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
54
ios/WuKongIMSDK.framework/Headers/WKReminder.h
Normal file
54
ios/WuKongIMSDK.framework/Headers/WKReminder.h
Normal file
@ -0,0 +1,54 @@
|
||||
//
|
||||
// WKReminder.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2022/4/19.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKReminderTypeMentionMe = 1, // 有人@我
|
||||
} WKReminderType;
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKReminderUploadStatusSuccess, // 成功
|
||||
WKReminderUploadStatusWait, // 等待上传
|
||||
WKReminderUploadStatusError, // 上传错误
|
||||
} WKReminderUploadStatus; // 提醒项上传状态
|
||||
|
||||
@interface WKReminder : NSObject<NSCopying>
|
||||
|
||||
@property(nonatomic,assign) int64_t reminderID;
|
||||
@property(nonatomic,assign) uint64_t messageId;
|
||||
@property(nonatomic,assign) uint32_t messageSeq; // 消息序列号(用户唯一,有序)
|
||||
@property(nonatomic,strong) WKChannel *channel; // 频道
|
||||
@property(nonatomic,assign) WKReminderType type; // 提醒类型
|
||||
@property(nonatomic,copy) NSString *publisher; // 发布者uid
|
||||
|
||||
@property(nonatomic,copy) NSString *text; // 提醒文本
|
||||
|
||||
|
||||
@property(nonatomic,strong) NSDictionary *data; // 提醒包含的数据
|
||||
|
||||
@property(nonatomic,assign) BOOL isLocate; // 是否需要进行消息定位
|
||||
@property(nonatomic,assign) int64_t version;
|
||||
|
||||
@property(nonatomic,assign) BOOL done; // 用户是否完成提醒
|
||||
|
||||
@property(nonatomic,assign) WKReminderUploadStatus uploadStatus; // 上传状态 只对本地生效
|
||||
|
||||
/**
|
||||
转换为字典
|
||||
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(NSDictionary*) toDictionary;
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
49
ios/WuKongIMSDK.framework/Headers/WKReminderDB.h
Normal file
49
ios/WuKongIMSDK.framework/Headers/WKReminderDB.h
Normal file
@ -0,0 +1,49 @@
|
||||
//
|
||||
// WKReminderDB.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2022/4/19.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKReminder.h"
|
||||
#import "WKChannel.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKReminderDB : NSObject
|
||||
|
||||
+ (WKReminderDB *)shared;
|
||||
|
||||
-(void) addOrUpdates:(NSArray<WKReminder*>*)reminders;
|
||||
|
||||
/**
|
||||
获取等待done的提醒项
|
||||
*/
|
||||
-(NSDictionary<WKChannel*,NSArray<WKReminder*>*>*) getWaitDoneReminders:(NSArray<WKChannel*>*) channels;
|
||||
|
||||
-(NSArray<WKReminder*>*) getWaitDoneReminder:(WKChannel*) channel;
|
||||
|
||||
-(NSArray<WKReminder*>*) getWaitDoneReminders:(WKChannel*)channel type:(WKReminderType)type;
|
||||
|
||||
// 获取所有等待完成的提醒
|
||||
-(NSDictionary<WKChannel*,NSArray<WKReminder*>*>*) getAllWaitDoneReminders;
|
||||
|
||||
|
||||
-(int64_t) getMaxVersion;
|
||||
|
||||
// 将对应id的提醒更新为done状态
|
||||
-(void) updateDone:(NSArray<NSNumber*>*)ids;
|
||||
|
||||
// 更新过期的done=1的数据的上传状态为失败
|
||||
-(void) updateExpireDoneUploadStatusFail:(NSInteger)expireTime;
|
||||
|
||||
-(void) updateUploadStatus:(WKReminderUploadStatus)status reminderID:(NSNumber*)reminderID;
|
||||
|
||||
-(NSArray<WKReminder*>*) getWaitUploads;
|
||||
|
||||
// 获取提醒项列表
|
||||
-(NSArray<WKReminder*>*) getReminders:(NSArray<NSNumber*>*)ids;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
61
ios/WuKongIMSDK.framework/Headers/WKReminderManager.h
Normal file
61
ios/WuKongIMSDK.framework/Headers/WKReminderManager.h
Normal file
@ -0,0 +1,61 @@
|
||||
//
|
||||
// WKReminderManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2022/4/19.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKReminder.h"
|
||||
@class WKReminderManager;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
// 消息提醒提供
|
||||
typedef void(^WKReminderCallback)(NSArray<WKReminder*> * __nullable reminders,NSError * __nullable error);
|
||||
typedef void(^WKReminderProvider)(WKReminderCallback callback);
|
||||
|
||||
|
||||
// 消息提醒done提供
|
||||
typedef void(^WKReminderDoneCallback)(NSError * __nullable error);
|
||||
typedef void(^WKReminderDoneProvider)(NSArray<NSNumber*> *ids,WKReminderDoneCallback callback);
|
||||
|
||||
@protocol WKReminderManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
// 某个频道的reminders发生变化
|
||||
-(void) reminderManager:(WKReminderManager*)manager didChange:(WKChannel*)channel reminders:(NSArray<WKReminder*>*) reminders;
|
||||
|
||||
@end
|
||||
|
||||
@interface WKReminderManager : NSObject
|
||||
|
||||
+ (WKReminderManager *)shared;
|
||||
|
||||
-(void) sync;
|
||||
|
||||
-(void) done:(NSArray<NSNumber*>*)ids;
|
||||
|
||||
/**
|
||||
添加委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void) addDelegate:(id<WKReminderManagerDelegate>) delegate;
|
||||
|
||||
|
||||
/**
|
||||
移除委托
|
||||
|
||||
@param delegate <#delegate description#>
|
||||
*/
|
||||
-(void)removeDelegate:(id<WKReminderManagerDelegate>) delegate;
|
||||
|
||||
@property(nonatomic,copy) WKReminderProvider reminderProvider; // 消息提醒项内容同步提供者
|
||||
@property(nonatomic,copy) WKReminderDoneProvider reminderDoneProvider; // 消息提醒项完成提供者
|
||||
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
66
ios/WuKongIMSDK.framework/Headers/WKRetryManager.h
Normal file
66
ios/WuKongIMSDK.framework/Headers/WKRetryManager.h
Normal file
@ -0,0 +1,66 @@
|
||||
//
|
||||
// WKRetryManager.h
|
||||
// WuKongIMBase
|
||||
//
|
||||
// Created by tt on 2019/12/29.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessage.h"
|
||||
#import "WKReminder.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKRetryItem : NSObject
|
||||
// 消息
|
||||
@property(nonatomic,strong) WKMessage *message;
|
||||
@property(nonatomic,strong) WKMessageExtra *messageExtra;
|
||||
@property(nonatomic,strong) WKReminder *reminder;
|
||||
// 重试次数
|
||||
@property(nonatomic,assign) long retryCount;
|
||||
// 下次重试时间
|
||||
@property(nonatomic,assign) long nextRetryTime;
|
||||
|
||||
@property(nonatomic,assign) long nextRetryTime2;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@interface WKRetryManager : NSObject
|
||||
|
||||
+ (WKRetryManager *)shared;
|
||||
|
||||
|
||||
/**
|
||||
开启重试
|
||||
*/
|
||||
-(void) start;
|
||||
|
||||
|
||||
/**
|
||||
停止重试
|
||||
*/
|
||||
-(void) stop;
|
||||
/**
|
||||
添加重试项
|
||||
|
||||
@param message 消息
|
||||
*/
|
||||
-(void) add:(WKMessage*)message;
|
||||
|
||||
-(void) addMessageExtra:(WKMessageExtra*)messageExtra;
|
||||
|
||||
/**
|
||||
移除重试项
|
||||
|
||||
@param key key
|
||||
*/
|
||||
-(void) removeRetryItem:(NSString*) key;
|
||||
|
||||
-(void) removeMessageExtraRetryItem:(NSString*) key;
|
||||
|
||||
-(void) addReminder:(WKReminder*)reminder;
|
||||
-(void) removeReminderRetryItem:(NSString*)key;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
43
ios/WuKongIMSDK.framework/Headers/WKRobot.h
Normal file
43
ios/WuKongIMSDK.framework/Headers/WKRobot.h
Normal file
@ -0,0 +1,43 @@
|
||||
//
|
||||
// WKRobot.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/10/19.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKRobotStatusDisable,
|
||||
WKRobotStatusEnable,
|
||||
} WKRobotStatus;
|
||||
|
||||
@class WKRobotMenus;
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKRobot : NSObject
|
||||
|
||||
@property (nonatomic, copy) NSString *robotID;
|
||||
|
||||
@property (nonatomic, copy) NSString *username; // 机器人username
|
||||
|
||||
@property (nonatomic, assign) long version;
|
||||
|
||||
@property(nonatomic,assign) WKRobotStatus status;
|
||||
|
||||
@property(nonatomic,assign) BOOL inlineOn; // 是否支持行内搜索
|
||||
@property(nonatomic,copy) NSString *placeholder; // 如果支持行内搜索 则占位字符内容
|
||||
|
||||
@property (nonatomic, strong) NSArray<WKRobotMenus*> *menus;
|
||||
|
||||
@end
|
||||
|
||||
@interface WKRobotMenus : NSObject
|
||||
@property (nonatomic, copy) NSString *robotID;
|
||||
@property (nonatomic, copy) NSString *cmd;
|
||||
@property (nonatomic, copy) NSString *remark;
|
||||
@property (nonatomic, copy) NSString *type;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
28
ios/WuKongIMSDK.framework/Headers/WKRobotDB.h
Normal file
28
ios/WuKongIMSDK.framework/Headers/WKRobotDB.h
Normal file
@ -0,0 +1,28 @@
|
||||
//
|
||||
// WKRobotDB.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/10/19.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKRobot.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKRobotDB : NSObject
|
||||
|
||||
+ (WKRobotDB *)shared;
|
||||
|
||||
/// 查询robot
|
||||
-(NSArray<WKRobot*>*) queryRobots:(NSArray<NSString*>*)robotIDs;
|
||||
|
||||
-(void) addOrUpdateRobots:(NSArray<WKRobot*>*)robots;
|
||||
|
||||
-(WKRobot*) queryRobotWithUsername:(NSString*)username;
|
||||
|
||||
-(NSArray<WKRobot*>*) queryRobotsWithUsernames:(NSArray<NSString*>*)usernames;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
36
ios/WuKongIMSDK.framework/Headers/WKRobotManager.h
Normal file
36
ios/WuKongIMSDK.framework/Headers/WKRobotManager.h
Normal file
@ -0,0 +1,36 @@
|
||||
//
|
||||
// WKRobotManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/10/19.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKRobot.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef void(^WKSyncRobotCallback)(NSArray<WKRobot*>* __nullable robots,NSError * __nullable error);
|
||||
typedef void(^WKSyncRobotProvider)(NSArray<NSDictionary*> *robotVersionDicts,WKSyncRobotCallback callback);
|
||||
|
||||
@interface WKRobotManager : NSObject
|
||||
|
||||
+ (WKRobotManager *)shared;
|
||||
|
||||
/// 机器人数据提供者
|
||||
@property(nonatomic,copy) WKSyncRobotProvider syncRobotProvider;
|
||||
|
||||
// 通过机器人id同步机器人
|
||||
-(void) sync:(NSArray<NSString*>*)robotIDs complete:(void(^)(BOOL hasData,NSError *error))complete;
|
||||
|
||||
// 通过username同步机器人
|
||||
-(void) syncWithUsernames:(NSArray<NSString*>*)usernames complete:(void(^)(BOOL hasData,NSError *error))complete;
|
||||
|
||||
/**
|
||||
获取机器人(通过username)
|
||||
@param username 机器人的用户名
|
||||
*/
|
||||
-(WKRobot*) getRobotWithUsername:(NSString*)username;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
165
ios/WuKongIMSDK.framework/Headers/WKSDK.h
Normal file
165
ios/WuKongIMSDK.framework/Headers/WKSDK.h
Normal file
@ -0,0 +1,165 @@
|
||||
//
|
||||
// WKSDK.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/23.
|
||||
//
|
||||
|
||||
#import "WuKongIMSDKHeader.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
|
||||
// 悟空IM SDK
|
||||
@interface WKSDK : NSObject
|
||||
|
||||
+ (WKSDK *)shared;
|
||||
|
||||
@property(nonatomic,strong) WKOptions* options;
|
||||
|
||||
/**
|
||||
连接信息串
|
||||
*/
|
||||
@property(nonatomic,copy) NSString *connectURL;
|
||||
|
||||
/**
|
||||
连接管理者
|
||||
*/
|
||||
@property(nonatomic,strong) WKConnectionManager *connectionManager;
|
||||
|
||||
|
||||
/**
|
||||
聊天管理者
|
||||
*/
|
||||
@property(nonatomic,strong) WKChatManager *chatManager;
|
||||
|
||||
|
||||
/**
|
||||
频道管理者
|
||||
*/
|
||||
@property(nonatomic,strong) WKChannelManager *channelManager;
|
||||
|
||||
/**
|
||||
频道信息提供者
|
||||
*/
|
||||
@property(nonatomic,strong) WKChannelInfoUpdate channelInfoUpdate;
|
||||
|
||||
|
||||
/**
|
||||
媒体文件管理者
|
||||
*/
|
||||
@property(nonatomic,strong) WKMediaManager *mediaManager;
|
||||
|
||||
|
||||
/**
|
||||
编码者
|
||||
*/
|
||||
@property(nonatomic,strong) WKCoder *coder;
|
||||
|
||||
|
||||
/**
|
||||
包body的编码解码者管理
|
||||
*/
|
||||
@property(nonatomic,strong) WKPakcetBodyCoderManager *bodyCoderManager;
|
||||
|
||||
|
||||
/**
|
||||
最近会话管理
|
||||
*/
|
||||
@property(nonatomic,strong) WKConversationManager *conversationManager;
|
||||
|
||||
|
||||
/// cmd管理者
|
||||
@property(nonatomic,strong) WKCMDManager *cmdManager;
|
||||
|
||||
// 消息已读回执管理者
|
||||
@property(nonatomic,strong) WKReceiptManager *receiptManager;
|
||||
|
||||
|
||||
// 消息回应管理
|
||||
// 负责点赞数据的维护
|
||||
@property(nonatomic,strong) WKReactionManager *reactionManager;
|
||||
|
||||
// 机器人管理者
|
||||
@property(nonatomic,strong) WKRobotManager *robotManager;
|
||||
|
||||
// 提醒管理者
|
||||
// 负责最近会话的提醒项,比如 有人@我,入群申请等等 还可以自定义一些提醒,比如类似微信的 [红包] [转账] 列表都会有提醒
|
||||
@property(nonatomic,strong) WKReminderManager *reminderManager;
|
||||
|
||||
@property(nonatomic,strong) WKFlameManager *flameManager; // 阅后即焚管理者
|
||||
|
||||
// sdk版本号,每次升级记得修改此处
|
||||
@property(nonatomic,copy,readonly) NSString *sdkVersion;
|
||||
|
||||
/**
|
||||
是否是debug模式
|
||||
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(BOOL) isDebug;
|
||||
|
||||
|
||||
|
||||
/// 注册消息正文
|
||||
/// @param cls 正文的class (需要继承WKMessageContent)
|
||||
-(void) registerMessageContent:(Class)cls;
|
||||
|
||||
|
||||
/// 注册消息正文(指定正文类型)
|
||||
/// @param cls 正文的class (需要继承WKMessageContent)
|
||||
/// @param contentType 正文类型
|
||||
-(void) registerMessageContent:(Class)cls contentType:(NSInteger)contentType;
|
||||
|
||||
|
||||
/**
|
||||
获取正文类型对应的正文对象
|
||||
|
||||
@param contentType <#contentType description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(Class) getMessageContent:(NSInteger)contentType;
|
||||
|
||||
|
||||
/**
|
||||
是否是系统消息 (目前规定的系统消息的contentType类型为 [1000,2000]之间)
|
||||
|
||||
@param contentType 正文类型
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(BOOL) isSystemMessage:(NSInteger)contentType;
|
||||
|
||||
|
||||
// 离线消息拉取(普通模式)
|
||||
@property(nonatomic,copy,readonly) WKOfflineMessagePull offlineMessagePull;
|
||||
@property(nonatomic,copy,readonly) WKOfflineMessageAck offlineMessageAck;
|
||||
|
||||
// 离线会话拉取(万人群模式)
|
||||
//@property(nonatomic,copy,readonly) WKOfflineMessagePull offlineMessagePull;
|
||||
|
||||
/**
|
||||
离线消息提供者
|
||||
|
||||
@param offlineMessageCallback 消息回调
|
||||
@param offlineMessageAckCallback ack回调
|
||||
*/
|
||||
-(void) setOfflineMessageProvider:(WKOfflineMessagePull) offlineMessageCallback offlineMessagesAck:(WKOfflineMessageAck) offlineMessageAckCallback;
|
||||
|
||||
|
||||
/**
|
||||
获取消息文件上传任务
|
||||
|
||||
@param message <#message description#>
|
||||
@return <#return value description#>
|
||||
*/
|
||||
-(WKMessageFileUploadTask*) getMessageFileUploadTask:(WKMessage*)message;
|
||||
|
||||
|
||||
/// 获取消息下载任务
|
||||
/// @param message <#message description#>
|
||||
-(WKMessageFileDownloadTask*) getMessageDownloadTask:(WKMessage*)message;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
48
ios/WuKongIMSDK.framework/Headers/WKSecurityManager.h
Normal file
48
ios/WuKongIMSDK.framework/Headers/WKSecurityManager.h
Normal file
@ -0,0 +1,48 @@
|
||||
//
|
||||
// WKSecurityManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/2/24.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKSecurityManager : NSObject
|
||||
|
||||
+ (WKSecurityManager *)shared;
|
||||
|
||||
@property(nonatomic,copy) NSString *sharedKey; // 共享key
|
||||
|
||||
|
||||
/**
|
||||
生成DH密钥对
|
||||
*/
|
||||
-(void) generateDHPair;
|
||||
|
||||
/**
|
||||
获取DH的公钥
|
||||
*/
|
||||
-(NSString*) getDHPubKey;
|
||||
|
||||
/**
|
||||
通过其他的公钥获取共享密钥
|
||||
*/
|
||||
-(void) generateAesKey:(NSString*)pubKey salt:(NSString*)salt;
|
||||
|
||||
/**
|
||||
加密数据
|
||||
*/
|
||||
-(NSString*) encryption:(NSString*)data;
|
||||
|
||||
/**
|
||||
解密
|
||||
*/
|
||||
-(NSString*) decryption:(NSString*)data;
|
||||
|
||||
- (NSString *)md5:(NSString *)input;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
37
ios/WuKongIMSDK.framework/Headers/WKSendPacket.h
Normal file
37
ios/WuKongIMSDK.framework/Headers/WKSendPacket.h
Normal file
@ -0,0 +1,37 @@
|
||||
//
|
||||
// WKSendPacket.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
#import "WKPacketBodyCoder.h"
|
||||
#import "WKSetting.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKSendPacket : WKPacket<WKPacketBodyCoder>
|
||||
|
||||
@property(nonatomic,strong) WKSetting *setting;
|
||||
|
||||
// 客户端提供的序列号,在客户端内唯一
|
||||
@property(nonatomic,assign) uint32_t clientSeq;
|
||||
|
||||
/// 客户端消息唯一编号
|
||||
@property(nonatomic,copy) NSString *clientMsgNo;
|
||||
|
||||
//频道ID(如果是个人频道ChannelId为个人的UID)
|
||||
@property(nonatomic,copy) NSString *channelId;
|
||||
//频道类型(1.个人 2.群组)
|
||||
@property(nonatomic,assign) uint8_t channelType;
|
||||
// 话题
|
||||
@property(nonatomic,copy) NSString *topic;
|
||||
// 负荷数据
|
||||
@property(nonatomic,strong) NSData *payload;
|
||||
|
||||
-(NSString*) veritifyString;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
25
ios/WuKongIMSDK.framework/Headers/WKSendackPacket.h
Normal file
25
ios/WuKongIMSDK.framework/Headers/WKSendackPacket.h
Normal file
@ -0,0 +1,25 @@
|
||||
//
|
||||
// WKSendackPacket.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/27.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKPacket.h"
|
||||
#import "WKPacketBodyCoder.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKSendackPacket : WKPacket<WKPacketBodyCoder>
|
||||
// 客户端序列号 (客户端提供,服务端原样返回)
|
||||
@property(nonatomic,assign) uint32_t clientSeq;
|
||||
// 消息ID(全局唯一)
|
||||
@property(nonatomic,assign) uint64_t messageId;
|
||||
// 消息序列号(用户唯一,有序)
|
||||
@property(nonatomic,assign) uint32_t messageSeq;
|
||||
// 原因代码
|
||||
@property(nonatomic,assign) uint8_t reasonCode;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
29
ios/WuKongIMSDK.framework/Headers/WKSetting.h
Normal file
29
ios/WuKongIMSDK.framework/Headers/WKSetting.h
Normal file
@ -0,0 +1,29 @@
|
||||
//
|
||||
// WKSetting.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/4/9.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKSetting : NSObject
|
||||
|
||||
|
||||
@property (nonatomic,assign) BOOL receiptEnabled; // 消息是否需要发送已读回执
|
||||
|
||||
//@property(nonatomic,assign) BOOL signal; // 是否signal加密
|
||||
|
||||
@property(nonatomic,assign) BOOL topic; // 是否存在话题
|
||||
|
||||
|
||||
|
||||
-(uint8_t) toUint8;
|
||||
|
||||
+(WKSetting*) fromUint8:(uint8_t)v;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
16
ios/WuKongIMSDK.framework/Headers/WKSignalErrorContent.h
Normal file
16
ios/WuKongIMSDK.framework/Headers/WKSignalErrorContent.h
Normal file
@ -0,0 +1,16 @@
|
||||
//
|
||||
// WKSignalErrorContent.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/9/9.
|
||||
//
|
||||
|
||||
#import <WuKongIMSDK/WuKongIMSDK.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKSignalErrorContent : WKMessageContent
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
@ -0,0 +1,21 @@
|
||||
//
|
||||
// WKSyncChannelMessageModel.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/10/5.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessage.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKSyncChannelMessageModel : NSObject
|
||||
|
||||
@property(nonatomic,assign) uint32_t startMessageSeq; // 开始消息序列号
|
||||
@property(nonatomic,assign) uint32_t endMessageSeq; // 结束消息序列号
|
||||
@property(nonatomic,assign) BOOL more; // 是否还有更多数据
|
||||
@property(nonatomic,strong) NSArray<WKMessage*> *messages; // 消息集合
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
70
ios/WuKongIMSDK.framework/Headers/WKSyncConversationModel.h
Normal file
70
ios/WuKongIMSDK.framework/Headers/WKSyncConversationModel.h
Normal file
@ -0,0 +1,70 @@
|
||||
//
|
||||
// WKOfflineConversation.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/9/30.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKChannel.h"
|
||||
#import "WKMessage.h"
|
||||
#import "WKConversation.h"
|
||||
|
||||
#import "WKCMDDB.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
|
||||
|
||||
@interface WKSyncConversationModel : NSObject
|
||||
|
||||
@property(nonatomic,strong) WKChannel *channel; // 频道
|
||||
|
||||
@property(nonatomic,strong) WKChannel *parentChannel; // 频道
|
||||
|
||||
@property(nonatomic,assign) NSInteger unread; // 消息未读数
|
||||
|
||||
@property(nonatomic,assign) BOOL mute;
|
||||
|
||||
@property(nonatomic,assign) BOOL stick;
|
||||
|
||||
@property(nonatomic,assign) NSTimeInterval timestamp; // 最后一次会话时间
|
||||
|
||||
@property(nonatomic,assign) uint32_t lastMsgSeq; // 最后一次会话的消息序列号
|
||||
|
||||
@property(nonatomic,copy) NSString *lastMsgClientNo; // 最后一次会话的消息客户端编号
|
||||
|
||||
@property(nonatomic,assign) long long version; // 数据版本
|
||||
|
||||
@property(nonatomic,strong) NSArray<WKMessage*> *recents; // 会话的最新消息集合
|
||||
|
||||
@property(nonatomic,strong) WKConversationExtra *remoteExtra;
|
||||
|
||||
@property(nonatomic,strong,readonly) WKConversation *conversation;
|
||||
|
||||
@end
|
||||
|
||||
@interface WKCMDModel : NSObject
|
||||
|
||||
@property(nonatomic,copy) NSString *no; // cmd唯一编号
|
||||
@property(nonatomic,copy) NSString *cmd;
|
||||
// 消息时间(服务器时间,单位秒)
|
||||
@property(nonatomic,assign) NSInteger timestamp;
|
||||
|
||||
// cmd 参数
|
||||
@property(nonatomic,strong) NSDictionary *param;
|
||||
|
||||
+(WKCMDModel*) message:(WKMessage*)message;
|
||||
|
||||
+(WKCMDModel*) cmdMessage:(WKCMDMessage*)cmdMessage;
|
||||
|
||||
@end
|
||||
|
||||
@interface WKSyncConversationWrapModel : NSObject
|
||||
|
||||
@property(nonatomic,strong) NSArray<WKSyncConversationModel*> *conversations;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
19
ios/WuKongIMSDK.framework/Headers/WKSystemContent.h
Normal file
19
ios/WuKongIMSDK.framework/Headers/WKSystemContent.h
Normal file
@ -0,0 +1,19 @@
|
||||
//
|
||||
// WKSystemContent.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/4.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessageContent.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKSystemContent : WKMessageContent
|
||||
|
||||
@property(nonatomic,strong) NSDictionary *content;
|
||||
@property(nonatomic,copy) NSString *displayContent;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
61
ios/WuKongIMSDK.framework/Headers/WKTaskManager.h
Normal file
61
ios/WuKongIMSDK.framework/Headers/WKTaskManager.h
Normal file
@ -0,0 +1,61 @@
|
||||
//
|
||||
// WKTaskManager.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/15.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKTaskProto.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@protocol WKTaskManagerDelegate <NSObject>
|
||||
|
||||
@optional
|
||||
|
||||
|
||||
/**
|
||||
任务完成
|
||||
|
||||
@param task <#task description#>
|
||||
*/
|
||||
-(void) taskComplete:(id<WKTaskProto>)task;
|
||||
|
||||
|
||||
/**
|
||||
任务进度
|
||||
|
||||
@param task <#task description#>
|
||||
*/
|
||||
-(void) taskProgress:(id<WKTaskProto>)task;
|
||||
|
||||
@end
|
||||
|
||||
@interface WKTaskManager : NSObject
|
||||
|
||||
@property(nonatomic,weak) id<WKTaskManagerDelegate> delegate;
|
||||
|
||||
/**
|
||||
添加任务
|
||||
|
||||
@param task <#task description#>
|
||||
*/
|
||||
-(void) add:(id<WKTaskProto>)task;
|
||||
|
||||
|
||||
/**
|
||||
获取任务
|
||||
|
||||
@param taskId <#taskId description#>
|
||||
*/
|
||||
-(id<WKTaskProto> __nullable) get:(NSString *)taskId;
|
||||
/**
|
||||
移除任务
|
||||
|
||||
@param task <#task description#>
|
||||
*/
|
||||
-(void) remove:(id<WKTaskProto>)task;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
33
ios/WuKongIMSDK.framework/Headers/WKTaskOperator.h
Normal file
33
ios/WuKongIMSDK.framework/Headers/WKTaskOperator.h
Normal file
@ -0,0 +1,33 @@
|
||||
//
|
||||
// WKTaskOperator.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2021/4/22.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKTaskOperator : NSObject
|
||||
|
||||
+(WKTaskOperator*) cancel:(void(^)(void))cancel suspend:(void(^)(void))suspend resume:(void(^)(void))resume;
|
||||
|
||||
/**
|
||||
取消
|
||||
*/
|
||||
@property (nonatomic, copy) void(^cancel)(void);
|
||||
|
||||
/**
|
||||
挂起
|
||||
*/
|
||||
@property (nonatomic, copy) void(^suspend)(void);
|
||||
|
||||
/**
|
||||
恢复
|
||||
*/
|
||||
@property (nonatomic, copy) void(^resume)(void);
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
84
ios/WuKongIMSDK.framework/Headers/WKTaskProto.h
Normal file
84
ios/WuKongIMSDK.framework/Headers/WKTaskProto.h
Normal file
@ -0,0 +1,84 @@
|
||||
//
|
||||
// WKTask.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/15.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
typedef enum : NSUInteger {
|
||||
WKTaskStatusWait, // 任务等待执行
|
||||
WKTaskStatusSuccess, // 任务执行成功
|
||||
WKTaskStatusProgressing, // 任务处理中
|
||||
WKTaskStatusSuspend, // 任务挂起
|
||||
WKTaskStatusError, // 任务执行错误
|
||||
WKTaskStatusCancel, // 任务执行错误
|
||||
} WKTaskStatus;
|
||||
|
||||
typedef void(^WKTaskListener)(void);
|
||||
|
||||
|
||||
@protocol WKTaskProto <NSObject>
|
||||
|
||||
|
||||
/**
|
||||
设置任务监听者
|
||||
*/
|
||||
@property(nonatomic,copy,readonly) NSArray<WKTaskListener> *listeners;
|
||||
|
||||
/**
|
||||
任务唯一ID
|
||||
*/
|
||||
@property(nonatomic,copy) NSString *taskId;
|
||||
|
||||
|
||||
/**
|
||||
任务状态
|
||||
*/
|
||||
@property(nonatomic,assign) WKTaskStatus status;
|
||||
|
||||
|
||||
/**
|
||||
添加监听者
|
||||
|
||||
@param listener 监听者
|
||||
@param target 目标
|
||||
*/
|
||||
- (void)addListener:(nonnull WKTaskListener)listener target:(id) target;
|
||||
|
||||
|
||||
/**
|
||||
移除监听者
|
||||
|
||||
@param target <#target description#>
|
||||
*/
|
||||
-(void) removeListener:(id) target;
|
||||
|
||||
/**
|
||||
恢复任务
|
||||
*/
|
||||
-(void) resume;
|
||||
/**
|
||||
暂停任务
|
||||
*/
|
||||
-(void) suspend;
|
||||
|
||||
|
||||
/**
|
||||
取消任务
|
||||
*/
|
||||
-(void) cancel;
|
||||
|
||||
|
||||
/**
|
||||
任务更新
|
||||
*/
|
||||
-(void) update;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
22
ios/WuKongIMSDK.framework/Headers/WKTextContent.h
Normal file
22
ios/WuKongIMSDK.framework/Headers/WKTextContent.h
Normal file
@ -0,0 +1,22 @@
|
||||
//
|
||||
// WKText.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/29.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessageContent.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKTextContent : WKMessageContent
|
||||
|
||||
- (instancetype)initWithContent:(NSString*)content;
|
||||
|
||||
@property(nonatomic,copy) NSString *content;
|
||||
|
||||
@property(nonatomic,copy,nullable) NSString *format; // 内容格式 默认为普通文本 html,markdown
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
19
ios/WuKongIMSDK.framework/Headers/WKUUIDUtil.h
Normal file
19
ios/WuKongIMSDK.framework/Headers/WKUUIDUtil.h
Normal file
@ -0,0 +1,19 @@
|
||||
//
|
||||
// WKUUIDUtil.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/5/28.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKUUIDUtil : NSObject
|
||||
|
||||
+ (NSString*)getUUID;
|
||||
|
||||
+(NSString*) getClientMsgNo:(NSString*)custId toCustId:(NSString*)toCustId chatId:(NSString*)chatId;
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
17
ios/WuKongIMSDK.framework/Headers/WKUnknownContent.h
Normal file
17
ios/WuKongIMSDK.framework/Headers/WKUnknownContent.h
Normal file
@ -0,0 +1,17 @@
|
||||
//
|
||||
// WKUnknownContent.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/29.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMessageContent.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKUnknownContent : WKMessageContent
|
||||
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
39
ios/WuKongIMSDK.framework/Headers/WKUserInfo.h
Normal file
39
ios/WuKongIMSDK.framework/Headers/WKUserInfo.h
Normal file
@ -0,0 +1,39 @@
|
||||
//
|
||||
// WKUser.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2019/11/29.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKUserInfo : NSObject
|
||||
|
||||
-(instancetype) initWithUid:(NSString*)uid name:(NSString*__nullable)name avatar:(NSString* __nullable)avatar;
|
||||
|
||||
-(instancetype) initWithUid:(NSString*)uid name:(NSString*)name;
|
||||
/*!
|
||||
用户ID
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *uid;
|
||||
|
||||
/*!
|
||||
用户名称
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *name;
|
||||
|
||||
/*!
|
||||
用户头像的URL
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *avatar;
|
||||
|
||||
/**
|
||||
用户信息附加字段
|
||||
*/
|
||||
@property (nonatomic, copy) NSString *extra;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
36
ios/WuKongIMSDK.framework/Headers/WKVoiceContent.h
Normal file
36
ios/WuKongIMSDK.framework/Headers/WKVoiceContent.h
Normal file
@ -0,0 +1,36 @@
|
||||
//
|
||||
// WKVoiceContent.h
|
||||
// WuKongIMSDK
|
||||
//
|
||||
// Created by tt on 2020/1/16.
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKMediaMessageContent.h"
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface WKVoiceContent : WKMediaMessageContent
|
||||
|
||||
|
||||
/**
|
||||
初始化
|
||||
|
||||
@param voiceData 音频数据
|
||||
@param second 音频秒长
|
||||
@param waveform 音频波浪数据 (可选参数)
|
||||
@return <#return value description#>
|
||||
*/
|
||||
+ (instancetype)initWithData:(NSData *)voiceData second:(int)second waveform:(NSData*)waveform;
|
||||
|
||||
|
||||
// 音频数据
|
||||
@property(nonatomic,strong) NSData *voiceData;
|
||||
|
||||
// 音频长度(单位秒)
|
||||
@property(nonatomic,assign) NSInteger second;
|
||||
// 音频波浪数据 (可选参数)
|
||||
@property(nonatomic,strong) NSData *waveform;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
110
ios/WuKongIMSDK.framework/Headers/WuKongIMSDK-umbrella.h
Normal file
110
ios/WuKongIMSDK.framework/Headers/WuKongIMSDK-umbrella.h
Normal file
@ -0,0 +1,110 @@
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#else
|
||||
#ifndef FOUNDATION_EXPORT
|
||||
#if defined(__cplusplus)
|
||||
#define FOUNDATION_EXPORT extern "C"
|
||||
#else
|
||||
#define FOUNDATION_EXPORT extern
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#import "WKConnackPacket.h"
|
||||
#import "WKConnectPacket.h"
|
||||
#import "WKDisconnectPacket.h"
|
||||
#import "WKPacket.h"
|
||||
#import "WKPingPacket.h"
|
||||
#import "WKPongPacket.h"
|
||||
#import "WKRecvackPacket.h"
|
||||
#import "WKRecvPacket.h"
|
||||
#import "WKSendackPacket.h"
|
||||
#import "WKSendPacket.h"
|
||||
#import "WKCoder.h"
|
||||
#import "WKData.h"
|
||||
#import "WKHeader.h"
|
||||
#import "WKPacketBodyCoder.h"
|
||||
#import "WKPakcetBodyCoderManager.h"
|
||||
#import "WKSetting.h"
|
||||
#import "WKChannelInfoDB.h"
|
||||
#import "WKChannelMemberDB.h"
|
||||
#import "WKCMDDB.h"
|
||||
#import "WKConversationDB.h"
|
||||
#import "WKConversationExtraDB.h"
|
||||
#import "WKConversationUtil.h"
|
||||
#import "WKDB.h"
|
||||
#import "WKDBMigrationManager.h"
|
||||
#import "WKFMDatabaseQueue.h"
|
||||
#import "WKMessageDB.h"
|
||||
#import "WKMessageExtraDB.h"
|
||||
#import "WKReactionDB.h"
|
||||
#import "WKReminderDB.h"
|
||||
#import "WKRobotDB.h"
|
||||
#import "WKBaseTask.h"
|
||||
#import "WKMessageFileDownloadTask.h"
|
||||
#import "WKMessageFileUploadTask.h"
|
||||
#import "WKTaskProto.h"
|
||||
#import "WKChannelManager.h"
|
||||
#import "WKChannelRequestQueue.h"
|
||||
#import "WKChatDataProvider.h"
|
||||
#import "WKChatManager.h"
|
||||
#import "WKChatManagerInner.h"
|
||||
#import "WKCMDManager.h"
|
||||
#import "WKConnectionManager.h"
|
||||
#import "WKConversationManager.h"
|
||||
#import "WKConversationManagerInner.h"
|
||||
#import "WKFlameManager.h"
|
||||
#import "WKMediaManager.h"
|
||||
#import "WKMOSContentConvertManager.h"
|
||||
#import "WKReactionManager.h"
|
||||
#import "WKReceiptManager.h"
|
||||
#import "WKReminderManager.h"
|
||||
#import "WKRetryManager.h"
|
||||
#import "WKRobotManager.h"
|
||||
#import "WKSecurityManager.h"
|
||||
#import "WKTaskManager.h"
|
||||
#import "WKCMDContent.h"
|
||||
#import "WKImageContent.h"
|
||||
#import "WKMediaMessageContent.h"
|
||||
#import "WKMessageContent.h"
|
||||
#import "WKMultiMediaMessageContent.h"
|
||||
#import "WKSignalErrorContent.h"
|
||||
#import "WKSystemContent.h"
|
||||
#import "WKTextContent.h"
|
||||
#import "WKUnknownContent.h"
|
||||
#import "WKVoiceContent.h"
|
||||
#import "WKChannel.h"
|
||||
#import "WKChannelInfo.h"
|
||||
#import "WKChannelInfoSearchResult.h"
|
||||
#import "WKChannelMessageSearchResult.h"
|
||||
#import "WKConnectInfo.h"
|
||||
#import "WKConversation.h"
|
||||
#import "WKConversationExtra.h"
|
||||
#import "WKConversationLastMessageAndUnreadCount.h"
|
||||
#import "WKMediaProto.h"
|
||||
#import "WKMessage.h"
|
||||
#import "WKMessageExtra.h"
|
||||
#import "WKMessageStatusModel.h"
|
||||
#import "WKReaction.h"
|
||||
#import "WKReminder.h"
|
||||
#import "WKRobot.h"
|
||||
#import "WKSyncChannelMessageModel.h"
|
||||
#import "WKSyncConversationModel.h"
|
||||
#import "WKTaskOperator.h"
|
||||
#import "WKUserInfo.h"
|
||||
#import "WKAESUtil.h"
|
||||
#import "WKFileUtil.h"
|
||||
#import "WKMediaUtil.h"
|
||||
#import "WKMemoryCache.h"
|
||||
#import "WKNOGeneraterUtil.h"
|
||||
#import "WKRSAUtil.h"
|
||||
#import "WKUUIDUtil.h"
|
||||
#import "WKConst.h"
|
||||
#import "WKOptions.h"
|
||||
#import "WKSDK.h"
|
||||
#import "WuKongIMSDK.h"
|
||||
#import "WuKongIMSDKHeader.h"
|
||||
|
||||
FOUNDATION_EXPORT double WuKongIMSDKVersionNumber;
|
||||
FOUNDATION_EXPORT const unsigned char WuKongIMSDKVersionString[];
|
||||
|
43
ios/WuKongIMSDK.framework/Headers/WuKongIMSDK.h
Normal file
43
ios/WuKongIMSDK.framework/Headers/WuKongIMSDK.h
Normal file
@ -0,0 +1,43 @@
|
||||
//
|
||||
// WuKongIMSDK.h
|
||||
// Pods
|
||||
//
|
||||
// Created by tt on 2019/11/23.
|
||||
//
|
||||
|
||||
#import "WKSDK.h"
|
||||
#import "WKConnackPacket.h"
|
||||
|
||||
#import "WKSendPacket.h"
|
||||
#import "WKDB.h"
|
||||
#import "WKChannel.h"
|
||||
#import "WKChannelManager.h"
|
||||
#import "WKMessageDB.h"
|
||||
#import "WKChannelInfoDB.h"
|
||||
|
||||
#import "WKVoiceContent.h"
|
||||
#import "WKMessageContent.h"
|
||||
#import "WKTextContent.h"
|
||||
#import "WKUnknownContent.h"
|
||||
#import "WKSystemContent.h"
|
||||
#import "WKImageContent.h"
|
||||
#import "WKMultiMediaMessageContent.h"
|
||||
#import "WKMessageFileUploadTask.h"
|
||||
#import "WKFileUtil.h"
|
||||
#import "WKConversation.h"
|
||||
#import "WKCMDContent.h"
|
||||
#import "WKMediaMessageContent.h"
|
||||
|
||||
#import "WKTaskProto.h"
|
||||
#import "WKMessageFileDownloadTask.h"
|
||||
#import "WKMemoryCache.h"
|
||||
|
||||
#import "WKSecurityManager.h"
|
||||
#import "WKAESUtil.h"
|
||||
#import "WKRobotDB.h"
|
||||
#import "WKMessageExtra.h"
|
||||
#import "WKMessageExtraDB.h"
|
||||
#import "WKReminderDB.h"
|
||||
|
||||
|
||||
|
75
ios/WuKongIMSDK.framework/Headers/WuKongIMSDKHeader.h
Normal file
75
ios/WuKongIMSDK.framework/Headers/WuKongIMSDKHeader.h
Normal file
@ -0,0 +1,75 @@
|
||||
//
|
||||
// WuKongIMSDKHeader.h
|
||||
// Pods
|
||||
//
|
||||
// Created by tt on 2022/12/13.
|
||||
//
|
||||
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "WKOptions.h"
|
||||
#import "WKConnectionManager.h"
|
||||
#import "WKCoder.h"
|
||||
#import "WKPakcetBodyCoderManager.h"
|
||||
#import "WKChatManager.h"
|
||||
#import "WKMessageContent.h"
|
||||
#import "WKConversationManager.h"
|
||||
#import "WKChannelManager.h"
|
||||
#import "WKMediaManager.h"
|
||||
#import "WKMessageFileUploadTask.h"
|
||||
#import "WKMessageFileDownloadTask.h"
|
||||
#import "WKTaskManager.h"
|
||||
#import "WKCMDManager.h"
|
||||
#import "WKReceiptManager.h"
|
||||
#import "WKTaskOperator.h"
|
||||
#import "WKReactionManager.h"
|
||||
#import "WKRobotManager.h"
|
||||
#import "WKReminderManager.h"
|
||||
#import "WKFlameManager.h"
|
||||
#import "WKConst.h"
|
||||
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
/**
|
||||
频道资料回调
|
||||
|
||||
@param error 错误
|
||||
*/
|
||||
typedef void (^WKChannelInfoCallback)(NSError * _Nullable error,bool notifyBefore);
|
||||
|
||||
|
||||
/**
|
||||
离线消息回调
|
||||
|
||||
@param messages 获取的离线消息
|
||||
@param more 是否还有更多消息
|
||||
@param error 错误信息
|
||||
*/
|
||||
typedef void(^WKOfflineMessageCallback)(NSArray<WKMessage*>* __nullable messages,bool more,NSError * __nullable error);
|
||||
|
||||
/**
|
||||
离线消息ack回调
|
||||
@param messageSeq 最后收到的消息序列号
|
||||
*/
|
||||
|
||||
typedef void(^WKOfflineMessageAck)(uint32_t messageSeq,void(^complete)(NSError *error));
|
||||
|
||||
|
||||
/**
|
||||
用户信息提供者 (第三方需要设置)
|
||||
|
||||
*/
|
||||
typedef WKTaskOperator* _Nullable (^WKChannelInfoUpdate)(WKChannel *channel,WKChannelInfoCallback callback);
|
||||
|
||||
|
||||
/**
|
||||
离线消息拉取
|
||||
|
||||
@param limit <#limit description#>
|
||||
@param messageSeq <#messageSeq description#>
|
||||
@param callback <#callback description#>
|
||||
*/
|
||||
typedef void (^WKOfflineMessagePull)(int limit,uint32_t messageSeq,WKOfflineMessageCallback callback);
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user