增加开发版本融云

This commit is contained in:
唐明明
2022-01-12 11:58:41 +08:00
parent 64ff207491
commit e9903312f6
242 changed files with 40411 additions and 25 deletions

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AvailableLibraries</key>
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<key>LibraryPath</key>
<string>RongIMWrapper.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-x86_64-simulator</string>
<key>LibraryPath</key>
<string>RongIMWrapper.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
<string>XFWK</string>
<key>XCFrameworkFormatVersion</key>
<string>1.0</string>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
//
// RCIMIWCommandMessage.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <RongIMWrapper/RCIMIWMessageContent.h>
#define RCIMIWCommandMessageIdentifier @"RC:IWCmdMsg"
@interface RCIMIWCommandMessage : RCIMIWMessageContent
@end

View File

@@ -0,0 +1,32 @@
//
// RCIMIWConverter.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/21.
//
#import <Foundation/Foundation.h>
#import <RongIMLibCore/RongIMLibCore.h>
//#import <RongLocation/RongLocation.h>
#import "RCIMIWPushNotificationMessage.h"
NS_ASSUME_NONNULL_BEGIN
@interface RCIMIWConverter : NSObject
+ (NSDictionary *)fromMessage:(RCMessage *)message;
+ (NSDictionary *)fromMessageContent:(NSString *)objectName messageContent:(RCMessageContent *)messageContent;
+ (NSDictionary *)fromConversation:(RCConversation *)conversation;
+ (NSDictionary *)fromConversationIdentifier:(RCConversationIdentifier *)conversationIdentifier;
+ (NSDictionary *)fromPushNotificationMessage:(RCIMIWPushNotificationMessage *)message;
+ (RCMessage *)toMessage:(NSDictionary *)map;
+ (RCMessageContent *)toMessageContent:(NSDictionary *)map;
+ (RCConversation *)toConversation:(NSDictionary *)map;
+ (RCConversationIdentifier *)toConversationIdentifier:(NSDictionary *)map;
+ (RCIMIWPushNotificationMessage *)toPushNotificationMessage:(NSDictionary *)map;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,95 @@
//
// RCIMIWDefine.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/24.
//
#ifndef RCIMIWDefine_h
#define RCIMIWDefine_h
#import <Foundation/Foundation.h>
#import <RongIMLibCore/RongIMLibCore.h>
@class RCIMIWPushNotificationMessage;
/// 连接状态
typedef NS_ENUM(NSInteger, RCIMIWConnectionStatus) {
/// 未知错误
RCIMIWConnectionStatusUnknown = -1,
/// 连接成功
RCIMIWConnectionStatusConnected = 0,
/// 连接中
RCIMIWConnectionStatusConnecting = 1,
/// 用户账户在其他设备登录,本机会被踢掉线
RCIMIWConnectionStatusKickedByOtherClient = 2,
/// 网络不可用
RCIMIWConnectionStatusNetworkUnavailable = 3,
/// Token 不正确
RCIMIWConnectionStatusTokenIncorrect = 4,
/// 用户被开发者后台封禁
RCIMIWConnectionStatusUserBlocked = 5,
/// 用户主动调用 disconnect 或 logout 接口断开连接
RCIMIWConnectionStatusDisConnected = 6,
/// 连接暂时挂起多是由于网络问题导致SDK 会在合适时机进行自动重连
RCIMIWConnectionStatusSuspend = 13,
/// 自动连接超时SDK 将不会继续连接,用户需要做超时处理,再自行调用 connectWithToken 接口进行连接
RCIMIWConnectionStatusTimeout = 14
};
typedef NSString * RCIMIWPushType;
extern RCIMIWPushType const RCIMIWPushType_UNKNOWN;
extern RCIMIWPushType const RCIMIWPushType_RONG;
extern RCIMIWPushType const RCIMIWPushType_HW;
extern RCIMIWPushType const RCIMIWPushType_MI;
extern RCIMIWPushType const RCIMIWPushType_FCM;
extern RCIMIWPushType const RCIMIWPushType_GCM;
extern RCIMIWPushType const RCIMIWPushType_MEIZU;
extern RCIMIWPushType const RCIMIWPushType_VIVO;
extern RCIMIWPushType const RCIMIWPushType_OPPO;
extern RCIMIWPushType const RCIMIWPushType_APPLE;
typedef NSString * RCIMIWPushSourceType;
extern RCIMIWPushSourceType const RCIMIWPushSourceTypeUnkown;
extern RCIMIWPushSourceType const RCIMIWPushSourceTypeOfflineMessage;
extern RCIMIWPushSourceType const RCIMIWPushSourceTypeFromAdmin;
extern RCIMIWPushSourceType const RCIMIWPushSourceTypeLocalMessage;
@protocol RCIMIWNotificationMessageListener <NSObject>
- (void)OnNotificationMessageArrived:(RCIMIWPushType)pushType
notificationMessage:(RCIMIWPushNotificationMessage *)notificationMessage;
- (void)OnNotificationMessageClicked:(RCIMIWPushType)pushType
notificationMessage:(RCIMIWPushNotificationMessage *)notificationMessage;
@end
typedef void(^RCIMIWOperationCallback)(RCErrorCode code);
typedef void(^RCIMIWOperationCallbackWithBool)(RCErrorCode code, BOOL flag);
typedef void(^RCIMIWOperationCallbackWithInt)(RCErrorCode code, int value);
typedef void(^RCIMIWOperationCallbackWithString)(RCErrorCode code, NSString *string);
typedef void(^RCIMIWOperationCallbackWithPushLanguage)(RCErrorCode code, RCPushLauguage pushLang);
typedef void(^RCIMIWOperationCallbackWithMessage)(RCErrorCode code, RCMessage *message);
typedef void(^RCIMIWOperationCallbackWithMessageList)(RCErrorCode code, NSArray *messages);
typedef void(^RCIMIWOperationCallbackWithConversation)(RCErrorCode code, RCConversation *conversation);
typedef void(^RCIMIWOperationCallbackWithConversationList)(RCErrorCode code, NSArray *conversations);
typedef void(^RCIMIWOperationCallbackWithConversationIdentifier)(RCErrorCode code, RCConversationIdentifier *identifier);
typedef void(^RCIMIWOperationCallbackWithSearchConversationResultList)(RCErrorCode code, NSArray<RCSearchConversationResult *> *searchConversationResults);
typedef void(^RCIMIWOperationCallbackWithConversationNotificationStatus)(RCErrorCode code, RCConversationNotificationStatus status);
typedef void(^RCIMIWOperationCallbackWithRecallNotificationMessage)(RCErrorCode code, RCRecallNotificationMessage *messageContent);
#endif /* RCIMIWDefine_h */

View File

@@ -0,0 +1,264 @@
//
// RCIMIWEngine.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/15.
//
#import <Foundation/Foundation.h>
#import "RCIMIWDefine.h"
@class RCIMIWEngineSetup;
NS_ASSUME_NONNULL_BEGIN
@interface RCIMIWEngine : NSObject
+ (instancetype)initWithAppKey:(NSString *)key;
+ (instancetype)initWithAppKey:(NSString *)key config:(RCIMIWEngineSetup *)config;
+ (instancetype)getInstance;
- (void)setDeviceTokenForApplePush:(NSString *)deviceToken;
- (void)setPushContentShowStatus:(BOOL)showContent callback:(RCIMIWOperationCallback)callback;
- (void)getPushContentShowStatus:(RCIMIWOperationCallbackWithBool)callback;
- (void)setPushLanguage:(RCPushLauguage)lang callback:(RCIMIWOperationCallback)callback;
- (void)getPushLanguage:(RCIMIWOperationCallbackWithPushLanguage)callback;
- (void)setPushReceiveStatus:(BOOL)receive callback:(RCIMIWOperationCallback)callback;
- (void)getPushReceiveStatus:(RCIMIWOperationCallbackWithBool)callback;
- (void)notifyOnNotificationMessageArrived:(RCIMIWPushType)pushType
notificationMessage:(RCIMIWPushNotificationMessage *)notificationMessage;
- (void)notifyOnNotificationMessageClicked:(RCIMIWPushType)pushType
notificationMessage:(RCIMIWPushNotificationMessage *)notificationMessage;
- (void)setOnNotificationMessageListener:(id<RCIMIWNotificationMessageListener>)listener;
- (void)setOfflineMessageDuration:(int)duration callback:(RCIMIWOperationCallback)callback;
- (void)getOfflineMessageDuration:(RCIMIWOperationCallbackWithInt)callback;
- (void)setKickReconnectedDevice:(BOOL)kick;
- (long long)getDeltaTime;
- (NSString *)getCurrentUserID;
// 连接管理
- (RCIMIWConnectionStatus)getConnectionStatus;
- (void)connect:(NSString *)token callback:(RCIMIWOperationCallbackWithString)callback;
- (void)disconnect;
- (void)logout;
// 会话管理
- (void)getConversation:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithConversation)callback;
- (void)removeConversation:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallback)callback;
- (void)getConversationList:(NSArray<NSNumber *> *)conversationTypes
callback:(RCIMIWOperationCallbackWithConversationList)callback;
- (void)getConversationListByPage:(NSArray<NSNumber *> *)conversationTypes
count:(int)count
startTime:(long long)startTime
callback:(RCIMIWOperationCallbackWithConversationList)callback;
- (void)searchConversation:(NSString *)keyword
conversationTypeList:(NSArray<NSNumber *> *)conversationTypes
objectNameList:(NSArray<NSString *> *)objectNames
callback:(RCIMIWOperationCallbackWithSearchConversationResultList)callback;
- (void)clearConversations:(NSArray<NSNumber *> *)conversationTypes
callback:(RCIMIWOperationCallback)callback;
// 草稿
- (void)getTextMessageDraft:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithString)callback;
- (void)saveTextMessageDraft:(RCConversationIdentifier *)identifier
textDraft:(NSString *)textDraft
callback:(RCIMIWOperationCallback)callback;
- (void)clearTextMessageDraft:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallback)callback;
// 未读计数
- (void)getUnreadCount:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithInt)callback;
- (void)getUnreadCountByTag:(NSString *)tagId
containBlocked:(BOOL)containBlocked
callback:(RCIMIWOperationCallbackWithInt)callback;
- (void)getUnreadCountByConversationTypes:(NSArray<NSNumber *> *)conversationTypes
containsDND:(BOOL)containsDND
callback:(RCIMIWOperationCallbackWithInt)callback;
- (void)getTotalUnreadCount:(RCIMIWOperationCallbackWithInt)callback;
- (void)clearMessagesUnreadStatus:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallback)callback;
- (void)getFirstUnreadMessage:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithMessage)callback;
- (void)getUnreadMentionedMessages:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithMessageList)callback;
// 会话提醒管理
- (void)setConversationNotificationStatus:(RCConversationIdentifier *)identifier
isBlocked:(BOOL)isBlocked
callback:(RCIMIWOperationCallbackWithConversationNotificationStatus)callback;
- (void)getConversationNotificationStatus:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithConversationNotificationStatus)callback;
- (void)getBlockedConversationList:(NSArray<NSNumber *> *)conversationTypes
callback:(RCIMIWOperationCallbackWithConversationList)callback;
// 会话置顶
- (void)setConversationStatusListener:(id<RCConversationStatusChangeDelegate>)listener;
- (void)setConversationToTop:(RCConversationIdentifier *)identifier
isTop:(BOOL)isTop
callback:(RCIMIWOperationCallback)callback;
- (void)getToppedConversationList:(NSArray<NSNumber *> *)conversationTypes
callback:(RCIMIWOperationCallbackWithConversationList)callback;
// 输入状态
- (void)setTypingStatusChangedListener:(id<RCTypingStatusDelegate>)listener;
- (void)setTypingUpdateSeconds:(NSInteger)typingUpdateSeconds;
- (void)sendTypingStatus:(RCConversationIdentifier *)identifier typingContent:(NSString *)typingContent;
// 消息管理
- (void)setOnMessageReceivedListener:(id<RCIMClientReceiveMessageDelegate>)listener;
- (void)getMessage:(long)messageId callback:(RCIMIWOperationCallbackWithMessage)callback;
- (void)getMessageByUid:(NSString *)messageUId callback:(RCIMIWOperationCallbackWithMessage)callback;
- (void)setMessageReceivedStatus:(long)messageId
status:(RCReceivedStatus)status
callback:(RCIMIWOperationCallback)callback;
- (void)setMessageSentStatus:(long)messageId
status:(RCSentStatus)status
callback:(RCIMIWOperationCallback)callback;
- (void)setMessageExtra:(long)messageId
extra:(NSString *)extra
callback:(RCIMIWOperationCallback)callback;
// 加载消息
- (void)getMessages:(RCConversationIdentifier *)identifier
option:(RCHistoryMessageOption *)option
callback:(RCIMIWOperationCallbackWithMessageList)callback;
// 以 messageId 为依据分页加载本地消息
- (void)getHistoryMessages:(RCConversationIdentifier *)identifier
lastMessageId:(long)lastMessageId
count:(int)count
callback:(RCIMIWOperationCallbackWithMessageList)callback;
// 本方法仅为指定时间跳转到消息,不可作为分页加载方法使用
- (void)getHistoryMessages:(RCConversationIdentifier *)identifier
sentTime:(long)sentTime
beforeCount:(int)beforeCount
afterCount:(int)afterCount
callback:(RCIMIWOperationCallbackWithMessageList)callback;
// 以时间为依据分页加载远端消息
- (void)getRemoteHistoryMessages:(RCConversationIdentifier *)identifier
remoteHistoryMsgOption:(RCRemoteHistoryMsgOption *)option
callback:(RCIMIWOperationCallbackWithMessageList)callback;
- (void)searchMessages:(RCConversationIdentifier *)identifier
keyword:(NSString *)keyword
count:(int)count
beginTime:(long)beginTime
callback:(RCIMIWOperationCallbackWithMessageList)callback;
// 发送消息
- (RCMessage *)sendMessage:(RCConversationIdentifier *)identifier
messageContent:(RCMessageContent *)content
pushContent:(NSString *)pushContent
pushData:(NSString *)pushData
messageConfig:(RCMessageConfig *)messageConfig
successBlock:(void (^)(RCMessage *successMessage))successBlock
errorBlock:(void (^)(RCErrorCode nErrorCode, RCMessage *errorMessage))errorBlock;
- (RCMessage *)sendMessage:(RCMessage *)message
pushContent:(NSString *)pushContent
pushData:(NSString *)pushData
sendOption:(RCSendMessageOption *)sendOption
successBlock:(void (^)(RCMessage *successMessage))successBlock
errorBlock:(void (^)(RCErrorCode nErrorCode, RCMessage *errorMessage))errorBlock;
// 发送媒体消息
- (RCMessage *)sendMediaMessage:(RCMessage *)message
pushContent:(NSString *)pushContent
pushData:(NSString *)pushData
progressBlock:(void (^)(int progress, RCMessage *progressMessage))progressBlock
successBlock:(void (^)(RCMessage *successMessage))successBlock
errorBlock:(void (^)(RCErrorCode nErrorCode, RCMessage *errorMessage))errorBlock
cancel:(void (^)(RCMessage *cancelMessage))cancelBlock;
// 发送定向消息
- (RCMessage *)sendDirectionalMessage:(RCConversationIdentifier *)identifier
userIdList:(NSArray<NSString *> *)userIdList
messageContent:(RCMessageContent *)messageContent
pushContent:(NSString *)pushContent
pushData:(NSString *)pushData
successBlock:(void (^)(RCMessage *successMessage))successBlock
errorBlock:(void (^)(RCErrorCode nErrorCode, RCMessage *errorMessage))errorBlock;
// 媒体消息下载管理
- (void)downloadMediaMessage:(RCMessage *)message
progress:(void (^)(int progress))progressBlock
success:(void (^)(NSString *mediaPath))successBlock
error:(void (^)(RCErrorCode errorCode))errorBlock
cancel:(void (^)(void))cancelBlock;
- (void)cancelDownloadMediaMessage:(RCMessage *)message;
// 本地插入消息
- (void)insertMessages:(NSArray<RCMessage *> *)messageList
callback:(RCIMIWOperationCallback)callback;
- (void)insertIncomingMessage:(RCConversationIdentifier *)identifier
senderId:(NSString *)senderId
receivedStatus:(RCReceivedStatus)receivedStatus
content:(RCMessageContent *)content
sentTime:(long long)sentTime
callback:(RCIMIWOperationCallbackWithMessage)callback;
- (void)insertOutgoingMessage:(RCConversationIdentifier *)identifier
senderId:(NSString *)senderId
sentStatus:(RCSentStatus)sentStatus
content:(RCMessageContent *)content
sentTime:(long long)sentTime
callback:(RCIMIWOperationCallbackWithMessage)callback;
// 撤回
- (void)recallMessage:(RCMessage *)message
pushContent:(NSString *)pushContent
callback:(RCIMIWOperationCallbackWithRecallNotificationMessage)callback;
// 删除消息
- (void)deleteMessages:(NSArray<NSNumber *> *)messageIdList
callback:(RCIMIWOperationCallback)callback;
- (void)deleteRemoteMessages:(RCConversationIdentifier *)identifier
messageList:(NSArray<RCMessage *> *)messageList
callback:(RCIMIWOperationCallback)callback;
- (void)clearMessages:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallback)callback;
- (void)clearRemoteMessages:(RCConversationIdentifier *)identifier
recordTime:(long long)recordTime
callback:(RCIMIWOperationCallback)callback;
// 已读回执
- (void)sendReadReceiptMessage:(RCConversationIdentifier *)identifier
timestamp:(long long)timestamp
callback:(RCIMIWOperationCallback)callback;
- (void)sendReadReceiptRequest:(RCMessage *)message
callback:(RCIMIWOperationCallback)callback;
- (void)sendReadReceiptResponse:(RCConversationIdentifier *)identifier
messageList:(NSArray<RCMessage *> *)messageList
callback:(RCIMIWOperationCallback)callback;
- (void)syncConversationReadStatus:(RCConversationIdentifier *)identifier
timestamp:(long long)timestamp
callback:(RCIMIWOperationCallbackWithConversationIdentifier)callback;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,24 @@
//
// RCIMIWEngineSetup.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/15.
//
#import <Foundation/Foundation.h>
@class RCIMIWImageCompressConfig;
NS_ASSUME_NONNULL_BEGIN
@interface RCIMIWEngineSetup : NSObject
@property (nonatomic, copy) NSString *naviServer;
@property (nonatomic, copy) NSString *fileServer;
@property (nonatomic, copy) NSString *statisticServer;
@property (nonatomic, copy) NSString *appVersion;
@property (nonatomic, strong) RCIMIWImageCompressConfig *imageCompressConfig;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,37 @@
//
// RCIMIWImageCompressConfig.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface RCIMIWImageCompressConfig : NSObject
// 大图压缩率
@property(nonatomic, assign) int imageQuality;
// 大图压缩最大边
@property(nonatomic, assign) int imageMaxSize;
// 大图剪裁阈值 200k
@property(nonatomic, assign) int imageMinLength;
// 缩略图压缩率
@property(nonatomic, assign) int thumbQuality;
// 生成缩略图最大边
@property(nonatomic, assign) int thumbMaxSize;
// 缩略图最小边,小于则使用原图
@property(nonatomic, assign) int thumbMinSize;
@property(nonatomic, assign) int sightCompressWidth;
@property(nonatomic, assign) int sightCompressHeight;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,19 @@
//
// RCIMIWMessageContent.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <RongIMLibCore/RongIMLibCore.h>
@interface RCIMIWMessageContent : RCMessageContent
@property (nonatomic, copy) NSString *messageType;
@property (nonatomic, strong) NSDictionary<NSString*, NSString*> *mFields;
+ (instancetype)messageWithType:(NSString *)messageType fields:(NSDictionary<NSString*, NSString*> *)fields;
@end

View File

@@ -0,0 +1,14 @@
//
// RCIMIWNormalMessage.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <RongIMWrapper/RCIMIWMessageContent.h>
#define RCIMIWNormalMessageIdentifier @"RC:IWNormalMsg"
@interface RCIMIWNormalMessage : RCIMIWMessageContent
@end

View File

@@ -0,0 +1,45 @@
//
// RCIMIWPushNotificationMessage.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/24.
//
#import <Foundation/Foundation.h>
#import <RongIMLibCore/RongIMLibCore.h>
#import "RCIMIWDefine.h"
NS_ASSUME_NONNULL_BEGIN
@interface RCIMIWPushNotificationMessage : NSObject
/// 对应推送消息的唯一Id,如果是消息转push则为消息的uid
@property (nonatomic, copy) NSString *pushId;
@property (nonatomic, copy) NSString *targetId;
@property (nonatomic, copy) NSString *objectName;
@property (nonatomic, copy) NSString *senderId;
@property (nonatomic, copy) NSString *senderName;
@property (nonatomic, copy) NSString *senderPortrait;
@property (nonatomic, copy) NSString *targetUserName;
@property (nonatomic, copy) NSString *toUserId;
@property (nonatomic, copy) NSString *pushTitle;
@property (nonatomic, copy) NSString *pushContent;
@property (nonatomic, copy) NSString *pushData;
@property (nonatomic, copy) NSString *extra;
@property (nonatomic, assign) RCConversationType conversationType;
@property (nonatomic, assign) long receivedTime;
@property (nonatomic, assign) bool showPushTitle;
@property (nonatomic, assign) bool showPushContent;
///是push消息时为true, 后台消息时为false
@property (nonatomic, assign) bool isFromPush;
@property (nonatomic, copy) RCIMIWPushSourceType pushSource;
@property (nonatomic, copy) NSString *notifycationId;
@property (nonatomic, copy) NSString *channelId;
@property (nonatomic, copy) NSString *collapseKeyFCM;
@property (nonatomic, copy) NSString *imageUrl;
@property (nonatomic, copy) NSString *busChannel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,14 @@
//
// RCIMIWStatusMessage.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <RongIMWrapper/RCIMIWMessageContent.h>
#define RCIMIWStatusMessageIdentifier @"RC:IWStatusMsg"
@interface RCIMIWStatusMessage : RCIMIWMessageContent
@end

View File

@@ -0,0 +1,15 @@
//
// RCIMIWStorageMessage.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <RongIMWrapper/RCIMIWMessageContent.h>
#define RCIMIWStorageMessageIdentifier @"RC:IWStorageMsg"
@interface RCIMIWStorageMessage : RCIMIWMessageContent
@end

View File

@@ -0,0 +1,32 @@
//
// RongIMWrapper.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/15.
//
#import <Foundation/Foundation.h>
//! Project version number for RongIMWrapper.
FOUNDATION_EXPORT double RongIMWrapperVersionNumber;
//! Project version string for RongIMWrapper.
FOUNDATION_EXPORT const unsigned char RongIMWrapperVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <RongIMWrapper/PublicHeader.h>
#import <RongIMWrapper/RCIMIWEngine.h>
#import <RongIMWrapper/RCIMIWEngineSetup.h>
#import <RongIMWrapper/RCIMIWImageCompressConfig.h>
#import <RongIMWrapper/RCIMIWMessageContent.h>
#import <RongIMWrapper/RCIMIWCommandMessage.h>
#import <RongIMWrapper/RCIMIWStorageMessage.h>
#import <RongIMWrapper/RCIMIWNormalMessage.h>
#import <RongIMWrapper/RCIMIWStatusMessage.h>
#import <RongIMWrapper/RCIMIWDefine.h>
#import <RongIMWrapper/RCIMIWConverter.h>
#import <RongIMWrapper/RCIMIWPushNotificationMessage.h>

View File

@@ -0,0 +1,6 @@
framework module RongIMWrapper {
umbrella header "RongIMWrapper.h"
export *
module * { export * }
}

View File

@@ -0,0 +1,297 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Headers/RCIMIWCommandMessage.h</key>
<data>
ZQ52UXbOAdfigPH2FHGziwZqfPU=
</data>
<key>Headers/RCIMIWConverter.h</key>
<data>
2tcFF2QxQCl85x6urcAMfmiwvw0=
</data>
<key>Headers/RCIMIWDefine.h</key>
<data>
FmyCcBBaD7dErYWHZFmUUNwzXhs=
</data>
<key>Headers/RCIMIWEngine.h</key>
<data>
HCzSGfMsaj7eU+qHhreiR463PfE=
</data>
<key>Headers/RCIMIWEngineSetup.h</key>
<data>
yJvIW/xyt+7/PmxrigAVL1jpFHk=
</data>
<key>Headers/RCIMIWImageCompressConfig.h</key>
<data>
7WK7aVAPQUYENqtDkD99KoKlZoA=
</data>
<key>Headers/RCIMIWMessageContent.h</key>
<data>
MlVDCiMBsT/avbkHRcEBPIaHBNw=
</data>
<key>Headers/RCIMIWNormalMessage.h</key>
<data>
dovprQVgKElUjkMd56usnPz2Lbo=
</data>
<key>Headers/RCIMIWPushNotificationMessage.h</key>
<data>
shi/Ni1iEM4JuypF+QVvrkelfC8=
</data>
<key>Headers/RCIMIWStatusMessage.h</key>
<data>
LsuAf4sUNhY1PP3lphtJRHRXfmk=
</data>
<key>Headers/RCIMIWStorageMessage.h</key>
<data>
lFiInD5zn5libwMvZHx0w8tL/AU=
</data>
<key>Headers/RongIMWrapper.h</key>
<data>
1gv4zl3JTEKX+BYouhW3Z0UKD5k=
</data>
<key>Info.plist</key>
<data>
OqLI6UwlZHc1+keO1Y+jGGeP130=
</data>
<key>Modules/module.modulemap</key>
<data>
NZ9No+S4WqrWW5TykXH9+Z5euVk=
</data>
</dict>
<key>files2</key>
<dict>
<key>Headers/RCIMIWCommandMessage.h</key>
<dict>
<key>hash</key>
<data>
ZQ52UXbOAdfigPH2FHGziwZqfPU=
</data>
<key>hash2</key>
<data>
w4P9G/xC1kTZtnTRphUldOWNv6mIOLUtkQ0Dwyxj6SU=
</data>
</dict>
<key>Headers/RCIMIWConverter.h</key>
<dict>
<key>hash</key>
<data>
2tcFF2QxQCl85x6urcAMfmiwvw0=
</data>
<key>hash2</key>
<data>
Z4at3N/ctR77daoY0a+eG61yCBouipwUC5ThtcSJTcc=
</data>
</dict>
<key>Headers/RCIMIWDefine.h</key>
<dict>
<key>hash</key>
<data>
FmyCcBBaD7dErYWHZFmUUNwzXhs=
</data>
<key>hash2</key>
<data>
S5sxx8KM53v03Z+UFiaXuj6Rc3wzIgvMbC6l/bWEXw8=
</data>
</dict>
<key>Headers/RCIMIWEngine.h</key>
<dict>
<key>hash</key>
<data>
HCzSGfMsaj7eU+qHhreiR463PfE=
</data>
<key>hash2</key>
<data>
a4ZuKdqzB7fZ6UMT2iIazi/HhmdaTL1eQdTvD//uVGY=
</data>
</dict>
<key>Headers/RCIMIWEngineSetup.h</key>
<dict>
<key>hash</key>
<data>
yJvIW/xyt+7/PmxrigAVL1jpFHk=
</data>
<key>hash2</key>
<data>
WwOFxDTsd5y3Fb/2uDYz/tSAbJbBvY60oEBZwpSrqQs=
</data>
</dict>
<key>Headers/RCIMIWImageCompressConfig.h</key>
<dict>
<key>hash</key>
<data>
7WK7aVAPQUYENqtDkD99KoKlZoA=
</data>
<key>hash2</key>
<data>
T5qobD0evP7Y0ZtOkdJHncg3g8lDRWzmenyo/5epAXw=
</data>
</dict>
<key>Headers/RCIMIWMessageContent.h</key>
<dict>
<key>hash</key>
<data>
MlVDCiMBsT/avbkHRcEBPIaHBNw=
</data>
<key>hash2</key>
<data>
cUiPIlFoZznMI3Nsalfu6JDS//jeoNLSQNz/YnsKWzc=
</data>
</dict>
<key>Headers/RCIMIWNormalMessage.h</key>
<dict>
<key>hash</key>
<data>
dovprQVgKElUjkMd56usnPz2Lbo=
</data>
<key>hash2</key>
<data>
F12ip8NDW07mlsxBBwB6EikQvKjkLckG2hu7UpI+RIU=
</data>
</dict>
<key>Headers/RCIMIWPushNotificationMessage.h</key>
<dict>
<key>hash</key>
<data>
shi/Ni1iEM4JuypF+QVvrkelfC8=
</data>
<key>hash2</key>
<data>
jONoPwmkgjzj/vWRK418D1FYhfwIxb47PrYjb/ns4M0=
</data>
</dict>
<key>Headers/RCIMIWStatusMessage.h</key>
<dict>
<key>hash</key>
<data>
LsuAf4sUNhY1PP3lphtJRHRXfmk=
</data>
<key>hash2</key>
<data>
e0AyCQ91MrhfQIKRe+2ImiOUgno0lWmAQHqdoyeuAZE=
</data>
</dict>
<key>Headers/RCIMIWStorageMessage.h</key>
<dict>
<key>hash</key>
<data>
lFiInD5zn5libwMvZHx0w8tL/AU=
</data>
<key>hash2</key>
<data>
mD7LP94vSu9PLlQu/nX/fTkOy/rpUWVy/hFCk0dxF2g=
</data>
</dict>
<key>Headers/RongIMWrapper.h</key>
<dict>
<key>hash</key>
<data>
1gv4zl3JTEKX+BYouhW3Z0UKD5k=
</data>
<key>hash2</key>
<data>
qwXDwPwI5ZmvEHUipj9mZpudfUTYwrwG+HaR6+mZ+LA=
</data>
</dict>
<key>Modules/module.modulemap</key>
<dict>
<key>hash</key>
<data>
NZ9No+S4WqrWW5TykXH9+Z5euVk=
</data>
<key>hash2</key>
<data>
36RjpvjhhFKiIU/yFLXix/9LoU9JtswsvCOB2uxmCKE=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>

View File

@@ -0,0 +1,14 @@
//
// RCIMIWCommandMessage.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <RongIMWrapper/RCIMIWMessageContent.h>
#define RCIMIWCommandMessageIdentifier @"RC:IWCmdMsg"
@interface RCIMIWCommandMessage : RCIMIWMessageContent
@end

View File

@@ -0,0 +1,32 @@
//
// RCIMIWConverter.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/21.
//
#import <Foundation/Foundation.h>
#import <RongIMLibCore/RongIMLibCore.h>
//#import <RongLocation/RongLocation.h>
#import "RCIMIWPushNotificationMessage.h"
NS_ASSUME_NONNULL_BEGIN
@interface RCIMIWConverter : NSObject
+ (NSDictionary *)fromMessage:(RCMessage *)message;
+ (NSDictionary *)fromMessageContent:(NSString *)objectName messageContent:(RCMessageContent *)messageContent;
+ (NSDictionary *)fromConversation:(RCConversation *)conversation;
+ (NSDictionary *)fromConversationIdentifier:(RCConversationIdentifier *)conversationIdentifier;
+ (NSDictionary *)fromPushNotificationMessage:(RCIMIWPushNotificationMessage *)message;
+ (RCMessage *)toMessage:(NSDictionary *)map;
+ (RCMessageContent *)toMessageContent:(NSDictionary *)map;
+ (RCConversation *)toConversation:(NSDictionary *)map;
+ (RCConversationIdentifier *)toConversationIdentifier:(NSDictionary *)map;
+ (RCIMIWPushNotificationMessage *)toPushNotificationMessage:(NSDictionary *)map;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,95 @@
//
// RCIMIWDefine.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/24.
//
#ifndef RCIMIWDefine_h
#define RCIMIWDefine_h
#import <Foundation/Foundation.h>
#import <RongIMLibCore/RongIMLibCore.h>
@class RCIMIWPushNotificationMessage;
/// 连接状态
typedef NS_ENUM(NSInteger, RCIMIWConnectionStatus) {
/// 未知错误
RCIMIWConnectionStatusUnknown = -1,
/// 连接成功
RCIMIWConnectionStatusConnected = 0,
/// 连接中
RCIMIWConnectionStatusConnecting = 1,
/// 用户账户在其他设备登录,本机会被踢掉线
RCIMIWConnectionStatusKickedByOtherClient = 2,
/// 网络不可用
RCIMIWConnectionStatusNetworkUnavailable = 3,
/// Token 不正确
RCIMIWConnectionStatusTokenIncorrect = 4,
/// 用户被开发者后台封禁
RCIMIWConnectionStatusUserBlocked = 5,
/// 用户主动调用 disconnect 或 logout 接口断开连接
RCIMIWConnectionStatusDisConnected = 6,
/// 连接暂时挂起多是由于网络问题导致SDK 会在合适时机进行自动重连
RCIMIWConnectionStatusSuspend = 13,
/// 自动连接超时SDK 将不会继续连接,用户需要做超时处理,再自行调用 connectWithToken 接口进行连接
RCIMIWConnectionStatusTimeout = 14
};
typedef NSString * RCIMIWPushType;
extern RCIMIWPushType const RCIMIWPushType_UNKNOWN;
extern RCIMIWPushType const RCIMIWPushType_RONG;
extern RCIMIWPushType const RCIMIWPushType_HW;
extern RCIMIWPushType const RCIMIWPushType_MI;
extern RCIMIWPushType const RCIMIWPushType_FCM;
extern RCIMIWPushType const RCIMIWPushType_GCM;
extern RCIMIWPushType const RCIMIWPushType_MEIZU;
extern RCIMIWPushType const RCIMIWPushType_VIVO;
extern RCIMIWPushType const RCIMIWPushType_OPPO;
extern RCIMIWPushType const RCIMIWPushType_APPLE;
typedef NSString * RCIMIWPushSourceType;
extern RCIMIWPushSourceType const RCIMIWPushSourceTypeUnkown;
extern RCIMIWPushSourceType const RCIMIWPushSourceTypeOfflineMessage;
extern RCIMIWPushSourceType const RCIMIWPushSourceTypeFromAdmin;
extern RCIMIWPushSourceType const RCIMIWPushSourceTypeLocalMessage;
@protocol RCIMIWNotificationMessageListener <NSObject>
- (void)OnNotificationMessageArrived:(RCIMIWPushType)pushType
notificationMessage:(RCIMIWPushNotificationMessage *)notificationMessage;
- (void)OnNotificationMessageClicked:(RCIMIWPushType)pushType
notificationMessage:(RCIMIWPushNotificationMessage *)notificationMessage;
@end
typedef void(^RCIMIWOperationCallback)(RCErrorCode code);
typedef void(^RCIMIWOperationCallbackWithBool)(RCErrorCode code, BOOL flag);
typedef void(^RCIMIWOperationCallbackWithInt)(RCErrorCode code, int value);
typedef void(^RCIMIWOperationCallbackWithString)(RCErrorCode code, NSString *string);
typedef void(^RCIMIWOperationCallbackWithPushLanguage)(RCErrorCode code, RCPushLauguage pushLang);
typedef void(^RCIMIWOperationCallbackWithMessage)(RCErrorCode code, RCMessage *message);
typedef void(^RCIMIWOperationCallbackWithMessageList)(RCErrorCode code, NSArray *messages);
typedef void(^RCIMIWOperationCallbackWithConversation)(RCErrorCode code, RCConversation *conversation);
typedef void(^RCIMIWOperationCallbackWithConversationList)(RCErrorCode code, NSArray *conversations);
typedef void(^RCIMIWOperationCallbackWithConversationIdentifier)(RCErrorCode code, RCConversationIdentifier *identifier);
typedef void(^RCIMIWOperationCallbackWithSearchConversationResultList)(RCErrorCode code, NSArray<RCSearchConversationResult *> *searchConversationResults);
typedef void(^RCIMIWOperationCallbackWithConversationNotificationStatus)(RCErrorCode code, RCConversationNotificationStatus status);
typedef void(^RCIMIWOperationCallbackWithRecallNotificationMessage)(RCErrorCode code, RCRecallNotificationMessage *messageContent);
#endif /* RCIMIWDefine_h */

View File

@@ -0,0 +1,264 @@
//
// RCIMIWEngine.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/15.
//
#import <Foundation/Foundation.h>
#import "RCIMIWDefine.h"
@class RCIMIWEngineSetup;
NS_ASSUME_NONNULL_BEGIN
@interface RCIMIWEngine : NSObject
+ (instancetype)initWithAppKey:(NSString *)key;
+ (instancetype)initWithAppKey:(NSString *)key config:(RCIMIWEngineSetup *)config;
+ (instancetype)getInstance;
- (void)setDeviceTokenForApplePush:(NSString *)deviceToken;
- (void)setPushContentShowStatus:(BOOL)showContent callback:(RCIMIWOperationCallback)callback;
- (void)getPushContentShowStatus:(RCIMIWOperationCallbackWithBool)callback;
- (void)setPushLanguage:(RCPushLauguage)lang callback:(RCIMIWOperationCallback)callback;
- (void)getPushLanguage:(RCIMIWOperationCallbackWithPushLanguage)callback;
- (void)setPushReceiveStatus:(BOOL)receive callback:(RCIMIWOperationCallback)callback;
- (void)getPushReceiveStatus:(RCIMIWOperationCallbackWithBool)callback;
- (void)notifyOnNotificationMessageArrived:(RCIMIWPushType)pushType
notificationMessage:(RCIMIWPushNotificationMessage *)notificationMessage;
- (void)notifyOnNotificationMessageClicked:(RCIMIWPushType)pushType
notificationMessage:(RCIMIWPushNotificationMessage *)notificationMessage;
- (void)setOnNotificationMessageListener:(id<RCIMIWNotificationMessageListener>)listener;
- (void)setOfflineMessageDuration:(int)duration callback:(RCIMIWOperationCallback)callback;
- (void)getOfflineMessageDuration:(RCIMIWOperationCallbackWithInt)callback;
- (void)setKickReconnectedDevice:(BOOL)kick;
- (long long)getDeltaTime;
- (NSString *)getCurrentUserID;
// 连接管理
- (RCIMIWConnectionStatus)getConnectionStatus;
- (void)connect:(NSString *)token callback:(RCIMIWOperationCallbackWithString)callback;
- (void)disconnect;
- (void)logout;
// 会话管理
- (void)getConversation:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithConversation)callback;
- (void)removeConversation:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallback)callback;
- (void)getConversationList:(NSArray<NSNumber *> *)conversationTypes
callback:(RCIMIWOperationCallbackWithConversationList)callback;
- (void)getConversationListByPage:(NSArray<NSNumber *> *)conversationTypes
count:(int)count
startTime:(long long)startTime
callback:(RCIMIWOperationCallbackWithConversationList)callback;
- (void)searchConversation:(NSString *)keyword
conversationTypeList:(NSArray<NSNumber *> *)conversationTypes
objectNameList:(NSArray<NSString *> *)objectNames
callback:(RCIMIWOperationCallbackWithSearchConversationResultList)callback;
- (void)clearConversations:(NSArray<NSNumber *> *)conversationTypes
callback:(RCIMIWOperationCallback)callback;
// 草稿
- (void)getTextMessageDraft:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithString)callback;
- (void)saveTextMessageDraft:(RCConversationIdentifier *)identifier
textDraft:(NSString *)textDraft
callback:(RCIMIWOperationCallback)callback;
- (void)clearTextMessageDraft:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallback)callback;
// 未读计数
- (void)getUnreadCount:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithInt)callback;
- (void)getUnreadCountByTag:(NSString *)tagId
containBlocked:(BOOL)containBlocked
callback:(RCIMIWOperationCallbackWithInt)callback;
- (void)getUnreadCountByConversationTypes:(NSArray<NSNumber *> *)conversationTypes
containsDND:(BOOL)containsDND
callback:(RCIMIWOperationCallbackWithInt)callback;
- (void)getTotalUnreadCount:(RCIMIWOperationCallbackWithInt)callback;
- (void)clearMessagesUnreadStatus:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallback)callback;
- (void)getFirstUnreadMessage:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithMessage)callback;
- (void)getUnreadMentionedMessages:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithMessageList)callback;
// 会话提醒管理
- (void)setConversationNotificationStatus:(RCConversationIdentifier *)identifier
isBlocked:(BOOL)isBlocked
callback:(RCIMIWOperationCallbackWithConversationNotificationStatus)callback;
- (void)getConversationNotificationStatus:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallbackWithConversationNotificationStatus)callback;
- (void)getBlockedConversationList:(NSArray<NSNumber *> *)conversationTypes
callback:(RCIMIWOperationCallbackWithConversationList)callback;
// 会话置顶
- (void)setConversationStatusListener:(id<RCConversationStatusChangeDelegate>)listener;
- (void)setConversationToTop:(RCConversationIdentifier *)identifier
isTop:(BOOL)isTop
callback:(RCIMIWOperationCallback)callback;
- (void)getToppedConversationList:(NSArray<NSNumber *> *)conversationTypes
callback:(RCIMIWOperationCallbackWithConversationList)callback;
// 输入状态
- (void)setTypingStatusChangedListener:(id<RCTypingStatusDelegate>)listener;
- (void)setTypingUpdateSeconds:(NSInteger)typingUpdateSeconds;
- (void)sendTypingStatus:(RCConversationIdentifier *)identifier typingContent:(NSString *)typingContent;
// 消息管理
- (void)setOnMessageReceivedListener:(id<RCIMClientReceiveMessageDelegate>)listener;
- (void)getMessage:(long)messageId callback:(RCIMIWOperationCallbackWithMessage)callback;
- (void)getMessageByUid:(NSString *)messageUId callback:(RCIMIWOperationCallbackWithMessage)callback;
- (void)setMessageReceivedStatus:(long)messageId
status:(RCReceivedStatus)status
callback:(RCIMIWOperationCallback)callback;
- (void)setMessageSentStatus:(long)messageId
status:(RCSentStatus)status
callback:(RCIMIWOperationCallback)callback;
- (void)setMessageExtra:(long)messageId
extra:(NSString *)extra
callback:(RCIMIWOperationCallback)callback;
// 加载消息
- (void)getMessages:(RCConversationIdentifier *)identifier
option:(RCHistoryMessageOption *)option
callback:(RCIMIWOperationCallbackWithMessageList)callback;
// 以 messageId 为依据分页加载本地消息
- (void)getHistoryMessages:(RCConversationIdentifier *)identifier
lastMessageId:(long)lastMessageId
count:(int)count
callback:(RCIMIWOperationCallbackWithMessageList)callback;
// 本方法仅为指定时间跳转到消息,不可作为分页加载方法使用
- (void)getHistoryMessages:(RCConversationIdentifier *)identifier
sentTime:(long)sentTime
beforeCount:(int)beforeCount
afterCount:(int)afterCount
callback:(RCIMIWOperationCallbackWithMessageList)callback;
// 以时间为依据分页加载远端消息
- (void)getRemoteHistoryMessages:(RCConversationIdentifier *)identifier
remoteHistoryMsgOption:(RCRemoteHistoryMsgOption *)option
callback:(RCIMIWOperationCallbackWithMessageList)callback;
- (void)searchMessages:(RCConversationIdentifier *)identifier
keyword:(NSString *)keyword
count:(int)count
beginTime:(long)beginTime
callback:(RCIMIWOperationCallbackWithMessageList)callback;
// 发送消息
- (RCMessage *)sendMessage:(RCConversationIdentifier *)identifier
messageContent:(RCMessageContent *)content
pushContent:(NSString *)pushContent
pushData:(NSString *)pushData
messageConfig:(RCMessageConfig *)messageConfig
successBlock:(void (^)(RCMessage *successMessage))successBlock
errorBlock:(void (^)(RCErrorCode nErrorCode, RCMessage *errorMessage))errorBlock;
- (RCMessage *)sendMessage:(RCMessage *)message
pushContent:(NSString *)pushContent
pushData:(NSString *)pushData
sendOption:(RCSendMessageOption *)sendOption
successBlock:(void (^)(RCMessage *successMessage))successBlock
errorBlock:(void (^)(RCErrorCode nErrorCode, RCMessage *errorMessage))errorBlock;
// 发送媒体消息
- (RCMessage *)sendMediaMessage:(RCMessage *)message
pushContent:(NSString *)pushContent
pushData:(NSString *)pushData
progressBlock:(void (^)(int progress, RCMessage *progressMessage))progressBlock
successBlock:(void (^)(RCMessage *successMessage))successBlock
errorBlock:(void (^)(RCErrorCode nErrorCode, RCMessage *errorMessage))errorBlock
cancel:(void (^)(RCMessage *cancelMessage))cancelBlock;
// 发送定向消息
- (RCMessage *)sendDirectionalMessage:(RCConversationIdentifier *)identifier
userIdList:(NSArray<NSString *> *)userIdList
messageContent:(RCMessageContent *)messageContent
pushContent:(NSString *)pushContent
pushData:(NSString *)pushData
successBlock:(void (^)(RCMessage *successMessage))successBlock
errorBlock:(void (^)(RCErrorCode nErrorCode, RCMessage *errorMessage))errorBlock;
// 媒体消息下载管理
- (void)downloadMediaMessage:(RCMessage *)message
progress:(void (^)(int progress))progressBlock
success:(void (^)(NSString *mediaPath))successBlock
error:(void (^)(RCErrorCode errorCode))errorBlock
cancel:(void (^)(void))cancelBlock;
- (void)cancelDownloadMediaMessage:(RCMessage *)message;
// 本地插入消息
- (void)insertMessages:(NSArray<RCMessage *> *)messageList
callback:(RCIMIWOperationCallback)callback;
- (void)insertIncomingMessage:(RCConversationIdentifier *)identifier
senderId:(NSString *)senderId
receivedStatus:(RCReceivedStatus)receivedStatus
content:(RCMessageContent *)content
sentTime:(long long)sentTime
callback:(RCIMIWOperationCallbackWithMessage)callback;
- (void)insertOutgoingMessage:(RCConversationIdentifier *)identifier
senderId:(NSString *)senderId
sentStatus:(RCSentStatus)sentStatus
content:(RCMessageContent *)content
sentTime:(long long)sentTime
callback:(RCIMIWOperationCallbackWithMessage)callback;
// 撤回
- (void)recallMessage:(RCMessage *)message
pushContent:(NSString *)pushContent
callback:(RCIMIWOperationCallbackWithRecallNotificationMessage)callback;
// 删除消息
- (void)deleteMessages:(NSArray<NSNumber *> *)messageIdList
callback:(RCIMIWOperationCallback)callback;
- (void)deleteRemoteMessages:(RCConversationIdentifier *)identifier
messageList:(NSArray<RCMessage *> *)messageList
callback:(RCIMIWOperationCallback)callback;
- (void)clearMessages:(RCConversationIdentifier *)identifier
callback:(RCIMIWOperationCallback)callback;
- (void)clearRemoteMessages:(RCConversationIdentifier *)identifier
recordTime:(long long)recordTime
callback:(RCIMIWOperationCallback)callback;
// 已读回执
- (void)sendReadReceiptMessage:(RCConversationIdentifier *)identifier
timestamp:(long long)timestamp
callback:(RCIMIWOperationCallback)callback;
- (void)sendReadReceiptRequest:(RCMessage *)message
callback:(RCIMIWOperationCallback)callback;
- (void)sendReadReceiptResponse:(RCConversationIdentifier *)identifier
messageList:(NSArray<RCMessage *> *)messageList
callback:(RCIMIWOperationCallback)callback;
- (void)syncConversationReadStatus:(RCConversationIdentifier *)identifier
timestamp:(long long)timestamp
callback:(RCIMIWOperationCallbackWithConversationIdentifier)callback;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,24 @@
//
// RCIMIWEngineSetup.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/15.
//
#import <Foundation/Foundation.h>
@class RCIMIWImageCompressConfig;
NS_ASSUME_NONNULL_BEGIN
@interface RCIMIWEngineSetup : NSObject
@property (nonatomic, copy) NSString *naviServer;
@property (nonatomic, copy) NSString *fileServer;
@property (nonatomic, copy) NSString *statisticServer;
@property (nonatomic, copy) NSString *appVersion;
@property (nonatomic, strong) RCIMIWImageCompressConfig *imageCompressConfig;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,37 @@
//
// RCIMIWImageCompressConfig.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface RCIMIWImageCompressConfig : NSObject
// 大图压缩率
@property(nonatomic, assign) int imageQuality;
// 大图压缩最大边
@property(nonatomic, assign) int imageMaxSize;
// 大图剪裁阈值 200k
@property(nonatomic, assign) int imageMinLength;
// 缩略图压缩率
@property(nonatomic, assign) int thumbQuality;
// 生成缩略图最大边
@property(nonatomic, assign) int thumbMaxSize;
// 缩略图最小边,小于则使用原图
@property(nonatomic, assign) int thumbMinSize;
@property(nonatomic, assign) int sightCompressWidth;
@property(nonatomic, assign) int sightCompressHeight;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,19 @@
//
// RCIMIWMessageContent.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <RongIMLibCore/RongIMLibCore.h>
@interface RCIMIWMessageContent : RCMessageContent
@property (nonatomic, copy) NSString *messageType;
@property (nonatomic, strong) NSDictionary<NSString*, NSString*> *mFields;
+ (instancetype)messageWithType:(NSString *)messageType fields:(NSDictionary<NSString*, NSString*> *)fields;
@end

View File

@@ -0,0 +1,14 @@
//
// RCIMIWNormalMessage.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <RongIMWrapper/RCIMIWMessageContent.h>
#define RCIMIWNormalMessageIdentifier @"RC:IWNormalMsg"
@interface RCIMIWNormalMessage : RCIMIWMessageContent
@end

View File

@@ -0,0 +1,45 @@
//
// RCIMIWPushNotificationMessage.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/24.
//
#import <Foundation/Foundation.h>
#import <RongIMLibCore/RongIMLibCore.h>
#import "RCIMIWDefine.h"
NS_ASSUME_NONNULL_BEGIN
@interface RCIMIWPushNotificationMessage : NSObject
/// 对应推送消息的唯一Id,如果是消息转push则为消息的uid
@property (nonatomic, copy) NSString *pushId;
@property (nonatomic, copy) NSString *targetId;
@property (nonatomic, copy) NSString *objectName;
@property (nonatomic, copy) NSString *senderId;
@property (nonatomic, copy) NSString *senderName;
@property (nonatomic, copy) NSString *senderPortrait;
@property (nonatomic, copy) NSString *targetUserName;
@property (nonatomic, copy) NSString *toUserId;
@property (nonatomic, copy) NSString *pushTitle;
@property (nonatomic, copy) NSString *pushContent;
@property (nonatomic, copy) NSString *pushData;
@property (nonatomic, copy) NSString *extra;
@property (nonatomic, assign) RCConversationType conversationType;
@property (nonatomic, assign) long receivedTime;
@property (nonatomic, assign) bool showPushTitle;
@property (nonatomic, assign) bool showPushContent;
///是push消息时为true, 后台消息时为false
@property (nonatomic, assign) bool isFromPush;
@property (nonatomic, copy) RCIMIWPushSourceType pushSource;
@property (nonatomic, copy) NSString *notifycationId;
@property (nonatomic, copy) NSString *channelId;
@property (nonatomic, copy) NSString *collapseKeyFCM;
@property (nonatomic, copy) NSString *imageUrl;
@property (nonatomic, copy) NSString *busChannel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,14 @@
//
// RCIMIWStatusMessage.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <RongIMWrapper/RCIMIWMessageContent.h>
#define RCIMIWStatusMessageIdentifier @"RC:IWStatusMsg"
@interface RCIMIWStatusMessage : RCIMIWMessageContent
@end

View File

@@ -0,0 +1,15 @@
//
// RCIMIWStorageMessage.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/20.
//
#import <RongIMWrapper/RCIMIWMessageContent.h>
#define RCIMIWStorageMessageIdentifier @"RC:IWStorageMsg"
@interface RCIMIWStorageMessage : RCIMIWMessageContent
@end

View File

@@ -0,0 +1,32 @@
//
// RongIMWrapper.h
// RongIMWrapper
//
// Created by joyoki on 2021/12/15.
//
#import <Foundation/Foundation.h>
//! Project version number for RongIMWrapper.
FOUNDATION_EXPORT double RongIMWrapperVersionNumber;
//! Project version string for RongIMWrapper.
FOUNDATION_EXPORT const unsigned char RongIMWrapperVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <RongIMWrapper/PublicHeader.h>
#import <RongIMWrapper/RCIMIWEngine.h>
#import <RongIMWrapper/RCIMIWEngineSetup.h>
#import <RongIMWrapper/RCIMIWImageCompressConfig.h>
#import <RongIMWrapper/RCIMIWMessageContent.h>
#import <RongIMWrapper/RCIMIWCommandMessage.h>
#import <RongIMWrapper/RCIMIWStorageMessage.h>
#import <RongIMWrapper/RCIMIWNormalMessage.h>
#import <RongIMWrapper/RCIMIWStatusMessage.h>
#import <RongIMWrapper/RCIMIWDefine.h>
#import <RongIMWrapper/RCIMIWConverter.h>
#import <RongIMWrapper/RCIMIWPushNotificationMessage.h>

View File

@@ -0,0 +1,6 @@
framework module RongIMWrapper {
umbrella header "RongIMWrapper.h"
export *
module * { export * }
}

View File

@@ -0,0 +1,297 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>files</key>
<dict>
<key>Headers/RCIMIWCommandMessage.h</key>
<data>
ZQ52UXbOAdfigPH2FHGziwZqfPU=
</data>
<key>Headers/RCIMIWConverter.h</key>
<data>
2tcFF2QxQCl85x6urcAMfmiwvw0=
</data>
<key>Headers/RCIMIWDefine.h</key>
<data>
FmyCcBBaD7dErYWHZFmUUNwzXhs=
</data>
<key>Headers/RCIMIWEngine.h</key>
<data>
HCzSGfMsaj7eU+qHhreiR463PfE=
</data>
<key>Headers/RCIMIWEngineSetup.h</key>
<data>
yJvIW/xyt+7/PmxrigAVL1jpFHk=
</data>
<key>Headers/RCIMIWImageCompressConfig.h</key>
<data>
7WK7aVAPQUYENqtDkD99KoKlZoA=
</data>
<key>Headers/RCIMIWMessageContent.h</key>
<data>
MlVDCiMBsT/avbkHRcEBPIaHBNw=
</data>
<key>Headers/RCIMIWNormalMessage.h</key>
<data>
dovprQVgKElUjkMd56usnPz2Lbo=
</data>
<key>Headers/RCIMIWPushNotificationMessage.h</key>
<data>
shi/Ni1iEM4JuypF+QVvrkelfC8=
</data>
<key>Headers/RCIMIWStatusMessage.h</key>
<data>
LsuAf4sUNhY1PP3lphtJRHRXfmk=
</data>
<key>Headers/RCIMIWStorageMessage.h</key>
<data>
lFiInD5zn5libwMvZHx0w8tL/AU=
</data>
<key>Headers/RongIMWrapper.h</key>
<data>
1gv4zl3JTEKX+BYouhW3Z0UKD5k=
</data>
<key>Info.plist</key>
<data>
AVfHN1OoaK4PwhZdjvTuZZnLPR4=
</data>
<key>Modules/module.modulemap</key>
<data>
NZ9No+S4WqrWW5TykXH9+Z5euVk=
</data>
</dict>
<key>files2</key>
<dict>
<key>Headers/RCIMIWCommandMessage.h</key>
<dict>
<key>hash</key>
<data>
ZQ52UXbOAdfigPH2FHGziwZqfPU=
</data>
<key>hash2</key>
<data>
w4P9G/xC1kTZtnTRphUldOWNv6mIOLUtkQ0Dwyxj6SU=
</data>
</dict>
<key>Headers/RCIMIWConverter.h</key>
<dict>
<key>hash</key>
<data>
2tcFF2QxQCl85x6urcAMfmiwvw0=
</data>
<key>hash2</key>
<data>
Z4at3N/ctR77daoY0a+eG61yCBouipwUC5ThtcSJTcc=
</data>
</dict>
<key>Headers/RCIMIWDefine.h</key>
<dict>
<key>hash</key>
<data>
FmyCcBBaD7dErYWHZFmUUNwzXhs=
</data>
<key>hash2</key>
<data>
S5sxx8KM53v03Z+UFiaXuj6Rc3wzIgvMbC6l/bWEXw8=
</data>
</dict>
<key>Headers/RCIMIWEngine.h</key>
<dict>
<key>hash</key>
<data>
HCzSGfMsaj7eU+qHhreiR463PfE=
</data>
<key>hash2</key>
<data>
a4ZuKdqzB7fZ6UMT2iIazi/HhmdaTL1eQdTvD//uVGY=
</data>
</dict>
<key>Headers/RCIMIWEngineSetup.h</key>
<dict>
<key>hash</key>
<data>
yJvIW/xyt+7/PmxrigAVL1jpFHk=
</data>
<key>hash2</key>
<data>
WwOFxDTsd5y3Fb/2uDYz/tSAbJbBvY60oEBZwpSrqQs=
</data>
</dict>
<key>Headers/RCIMIWImageCompressConfig.h</key>
<dict>
<key>hash</key>
<data>
7WK7aVAPQUYENqtDkD99KoKlZoA=
</data>
<key>hash2</key>
<data>
T5qobD0evP7Y0ZtOkdJHncg3g8lDRWzmenyo/5epAXw=
</data>
</dict>
<key>Headers/RCIMIWMessageContent.h</key>
<dict>
<key>hash</key>
<data>
MlVDCiMBsT/avbkHRcEBPIaHBNw=
</data>
<key>hash2</key>
<data>
cUiPIlFoZznMI3Nsalfu6JDS//jeoNLSQNz/YnsKWzc=
</data>
</dict>
<key>Headers/RCIMIWNormalMessage.h</key>
<dict>
<key>hash</key>
<data>
dovprQVgKElUjkMd56usnPz2Lbo=
</data>
<key>hash2</key>
<data>
F12ip8NDW07mlsxBBwB6EikQvKjkLckG2hu7UpI+RIU=
</data>
</dict>
<key>Headers/RCIMIWPushNotificationMessage.h</key>
<dict>
<key>hash</key>
<data>
shi/Ni1iEM4JuypF+QVvrkelfC8=
</data>
<key>hash2</key>
<data>
jONoPwmkgjzj/vWRK418D1FYhfwIxb47PrYjb/ns4M0=
</data>
</dict>
<key>Headers/RCIMIWStatusMessage.h</key>
<dict>
<key>hash</key>
<data>
LsuAf4sUNhY1PP3lphtJRHRXfmk=
</data>
<key>hash2</key>
<data>
e0AyCQ91MrhfQIKRe+2ImiOUgno0lWmAQHqdoyeuAZE=
</data>
</dict>
<key>Headers/RCIMIWStorageMessage.h</key>
<dict>
<key>hash</key>
<data>
lFiInD5zn5libwMvZHx0w8tL/AU=
</data>
<key>hash2</key>
<data>
mD7LP94vSu9PLlQu/nX/fTkOy/rpUWVy/hFCk0dxF2g=
</data>
</dict>
<key>Headers/RongIMWrapper.h</key>
<dict>
<key>hash</key>
<data>
1gv4zl3JTEKX+BYouhW3Z0UKD5k=
</data>
<key>hash2</key>
<data>
qwXDwPwI5ZmvEHUipj9mZpudfUTYwrwG+HaR6+mZ+LA=
</data>
</dict>
<key>Modules/module.modulemap</key>
<dict>
<key>hash</key>
<data>
NZ9No+S4WqrWW5TykXH9+Z5euVk=
</data>
<key>hash2</key>
<data>
36RjpvjhhFKiIU/yFLXix/9LoU9JtswsvCOB2uxmCKE=
</data>
</dict>
</dict>
<key>rules</key>
<dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^version.plist$</key>
<true/>
</dict>
<key>rules2</key>
<dict>
<key>.*\.dSYM($|/)</key>
<dict>
<key>weight</key>
<real>11</real>
</dict>
<key>^(.*/)?\.DS_Store$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>2000</real>
</dict>
<key>^.*</key>
<true/>
<key>^.*\.lproj/</key>
<dict>
<key>optional</key>
<true/>
<key>weight</key>
<real>1000</real>
</dict>
<key>^.*\.lproj/locversion.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>1100</real>
</dict>
<key>^Base\.lproj/</key>
<dict>
<key>weight</key>
<real>1010</real>
</dict>
<key>^Info\.plist$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^PkgInfo$</key>
<dict>
<key>omit</key>
<true/>
<key>weight</key>
<real>20</real>
</dict>
<key>^embedded\.provisionprofile$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
<key>^version\.plist$</key>
<dict>
<key>weight</key>
<real>20</real>
</dict>
</dict>
</dict>
</plist>