Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
std-s committed Mar 11, 2022
2 parents bb23b46 + cd4bea1 commit 218c3de
Show file tree
Hide file tree
Showing 18 changed files with 147 additions and 16 deletions.
60 changes: 54 additions & 6 deletions Example/OpenIMSDKiOS/OPENIMSDKViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ - (void)viewDidLoad
@{OIM_LIST_CELL_TITLE: @"获取指定用户信息", OIM_LIST_CELL_FUNC: @"getUsersInfo"}],

@[@{OIM_LIST_CELL_TITLE: @"添加好友", OIM_LIST_CELL_FUNC: @"addFriend"},
@{OIM_LIST_CELL_TITLE: @"获取好友申请列表", OIM_LIST_CELL_FUNC: @"getFriendApplicationList"},
@{OIM_LIST_CELL_TITLE: @"获取好友申请的列表", OIM_LIST_CELL_FUNC: @"getFriendApplicationList"},
@{OIM_LIST_CELL_TITLE: @"获取申请好友的列表", OIM_LIST_CELL_FUNC: @"getSendFriendApplicationList"},
@{OIM_LIST_CELL_TITLE: @"同意好友申请", OIM_LIST_CELL_FUNC: @"acceptFriendApplication"},
@{OIM_LIST_CELL_TITLE: @"拒绝好友申请", OIM_LIST_CELL_FUNC: @"refuseFriendApplication"},
@{OIM_LIST_CELL_TITLE: @"加黑名单", OIM_LIST_CELL_FUNC: @"addToBlackList"},
Expand All @@ -95,9 +96,11 @@ - (void)viewDidLoad
@{OIM_LIST_CELL_TITLE: @"踢出群", OIM_LIST_CELL_FUNC: @"kickGroupMember"},
@{OIM_LIST_CELL_TITLE: @"转让群主", OIM_LIST_CELL_FUNC: @"transferGroupOwner"},
@{OIM_LIST_CELL_TITLE: @"邀请某些人进群", OIM_LIST_CELL_FUNC: @"inviteUserToGroup"},
@{OIM_LIST_CELL_TITLE: @"获取申请进群列表", OIM_LIST_CELL_FUNC: @"getGroupApplicationList"},
@{OIM_LIST_CELL_TITLE: @"获取他人申请进群列表", OIM_LIST_CELL_FUNC: @"getGroupApplicationList"},
@{OIM_LIST_CELL_TITLE: @"获取发出的进群申请列表", OIM_LIST_CELL_FUNC: @"getSendGroupApplicationList"},
@{OIM_LIST_CELL_TITLE: @"同意某人进群", OIM_LIST_CELL_FUNC: @"acceptGroupApplication"},
@{OIM_LIST_CELL_TITLE: @"拒绝某人进群", OIM_LIST_CELL_FUNC: @"refuseGroupApplication"}],
@{OIM_LIST_CELL_TITLE: @"拒绝某人进群", OIM_LIST_CELL_FUNC: @"refuseGroupApplication"},
@{OIM_LIST_CELL_TITLE: @"清空群聊天记录", OIM_LIST_CELL_FUNC: @"clearGroupHistoryMessage"},],

@[@{OIM_LIST_CELL_TITLE: @"发送消息", OIM_LIST_CELL_FUNC: @"sendMessage"},
@{OIM_LIST_CELL_TITLE: @"获取聊天历史", OIM_LIST_CELL_FUNC: @"getHistoryMessageList"},
Expand Down Expand Up @@ -207,6 +210,8 @@ - (nullable NSString *)tableView:(UITableView *)tableView titleForHeaderInSectio
#pragma mark - function

- (void)callback {
// 亦可使用protocol的方式,请参阅sdk的callback头文件


[OIMManager.callbacker setSelfUserInfoUpdateListener:^(OIMUserInfo * _Nullable userInfo) {

Expand Down Expand Up @@ -335,6 +340,7 @@ - (void)loginStatus {
}

- (void)getSelfInfo {

[self operate:_cmd
todo:^(void (^callback)(NSNumber *code, NSString *msg)) {

Expand Down Expand Up @@ -407,6 +413,19 @@ - (void)getFriendApplicationList {
}];
}

- (void)getSendFriendApplicationList {
[self operate:_cmd
todo:^(void (^callback)(NSNumber *code, NSString *msg)) {

[OIMManager.manager getSendFriendApplicationListWithOnSuccess:^(NSArray<OIMFriendApplication *> * _Nullable friendApplications) {

callback(nil, nil);
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
callback(@(code), msg);
}];
}];
}

- (void)acceptFriendApplication {
[self operate:_cmd
todo:^(void (^callback)(NSNumber *code, NSString *msg)) {
Expand Down Expand Up @@ -492,6 +511,7 @@ - (void)getDesignatedFriendsInfo {
}

- (void)getFriendList {

[self operate:_cmd
todo:^(void (^callback)(NSNumber *code, NSString *msg)) {

Expand Down Expand Up @@ -554,12 +574,11 @@ - (void)createGroup {

OIMGroupCreateInfo *t = [OIMGroupCreateInfo new];
t.groupName = @"x的群";
t.groupType = 0;
t.introduction = @"群的简介";

OIMGroupMemberBaseInfo *m1 = [OIMGroupMemberBaseInfo new];
m1.userID = OTHER_USER_ID;
m1.roleLevel = 1;
m1.roleLevel = OIMGroupMemberRoleMember;

[OIMManager.manager createGroup:t
memberList:@[m1]
Expand Down Expand Up @@ -738,6 +757,19 @@ - (void)getGroupApplicationList {
}];
}

- (void)getSendGroupApplicationList {
[self operate:_cmd
todo:^(void (^callback)(NSNumber *code, NSString *msg)) {

[OIMManager.manager getSendGroupApplicationListWithOnSuccess:^(NSArray<OIMGroupApplicationInfo *> * _Nullable groupsInfo) {

callback(nil, nil);
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
callback(@(code), msg);
}];
}];
}

- (void)acceptGroupApplication {
[self operate:_cmd
todo:^(void (^callback)(NSNumber *code, NSString *msg)) {
Expand Down Expand Up @@ -770,6 +802,20 @@ - (void)refuseGroupApplication {
}];
}

- (void)clearGroupHistoryMessage {
[self operate:_cmd
todo:^(void (^callback)(NSNumber *code, NSString *msg)) {

[OIMManager.manager clearGroupHistoryMessage:GROUP_ID
onSuccess:^(NSString * _Nullable data) {

callback(nil, nil);
} onFailure:^(NSInteger code, NSString * _Nullable msg) {
callback(@(code), msg);
}];
}];
}

#pragma mark -
#pragma mark - Message

Expand Down Expand Up @@ -1054,6 +1100,8 @@ - (void)pinConversation {
}

- (void)getTotalUnreadMsgCount {


[self operate:_cmd
todo:^(void (^callback)(NSNumber *code, NSString *msg)) {

Expand Down Expand Up @@ -1099,7 +1147,7 @@ - (void)setConversationRecvMessageOpt {
todo:^(void (^callback)(NSNumber *code, NSString *msg)) {

[OIMManager.manager setConversationRecvMessageOpt:@[CONVERSASTION_ID]
status:1307
status:OIMReceiveMessageOptReceive
onSuccess:^(NSString * _Nullable data) {

callback(nil, nil);
Expand Down
10 changes: 5 additions & 5 deletions Framework/OpenIMCore.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@
<array>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>OpenIMCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64</string>
<key>LibraryPath</key>
<string>OpenIMCore.framework</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nul

FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);

FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFaceMessage(NSString* _Nullable operationID, long index, NSString* _Nullable data);

FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);

FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nul

FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);

FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFaceMessage(NSString* _Nullable operationID, long index, NSString* _Nullable data);

FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);

FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion OpenIMSDK.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Pod::Spec.new do |s|
s.name = 'OpenIMSDK'
s.version = '2.0.2'
s.version = '2.0.3'
s.summary = 'Open-IM-SDK'

# This description is used to generate tags and improve search results.
Expand Down
6 changes: 6 additions & 0 deletions OpenIMSDK/Interface/OIMManager+Friend.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ NS_ASSUME_NONNULL_BEGIN
- (void)getFriendApplicationListWithOnSuccess:(nullable OIMFriendApplicationsCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

/*
* 发出的好友申请
*/
- (void)getSendFriendApplicationListWithOnSuccess:(nullable OIMFriendApplicationsCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

/*
* 同意某人的好友申请
* @param uid 用户id
Expand Down
11 changes: 11 additions & 0 deletions OpenIMSDK/Interface/OIMManager+Friend.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ - (void)getFriendApplicationListWithOnSuccess:(OIMFriendApplicationsCallback)onS
Open_im_sdkGetRecvFriendApplicationList(callback, [self operationId]);
}

- (void)getSendFriendApplicationListWithOnSuccess:(OIMFriendApplicationsCallback)onSuccess
onFailure:(OIMFailureCallback)onFailure {
CallbackProxy *callback = [[CallbackProxy alloc]initWithOnSuccess:^(NSString * _Nullable data) {
if (onSuccess) {
onSuccess([OIMFriendApplication mj_objectArrayWithKeyValuesArray:data]);
}
} onFailure:onFailure];

Open_im_sdkGetSendFriendApplicationList(callback, [self operationId]);
}

- (void)acceptFriendApplication:(NSString *)uid
handleMsg:(NSString *)msg
onSuccess:(OIMSuccessCallback)onSuccess
Expand Down
7 changes: 7 additions & 0 deletions OpenIMSDK/Interface/OIMManager+Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,13 @@ NS_ASSUME_NONNULL_BEGIN
- (void)getGroupApplicationListWithOnSuccess:(nullable OIMGroupsApplicationCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

/*
* 发出的入群申请
*
*/
- (void)getSendGroupApplicationListWithOnSuccess:(nullable OIMGroupsApplicationCallback)onSuccess
onFailure:(nullable OIMFailureCallback)onFailure;

/*
* 管理员或者群主同意某人进入某群
*
Expand Down
11 changes: 11 additions & 0 deletions OpenIMSDK/Interface/OIMManager+Group.m
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,17 @@ - (void)getGroupApplicationListWithOnSuccess:(OIMGroupsApplicationCallback)onSuc
Open_im_sdkGetRecvGroupApplicationList(callback, [self operationId]);
}

- (void)getSendGroupApplicationListWithOnSuccess:(OIMGroupsApplicationCallback)onSuccess
onFailure:(OIMFailureCallback)onFailure {
CallbackProxy *callback = [[CallbackProxy alloc]initWithOnSuccess:^(NSString * _Nullable data) {
if (onSuccess) {
onSuccess([OIMGroupApplicationInfo mj_objectArrayWithKeyValuesArray:data]);
}
} onFailure:onFailure];

Open_im_sdkGetSendGroupApplicationList(callback, [self operationId]);
}

- (void)acceptGroupApplication:(NSString *)groupId
fromUserId:(NSString *)fromUserID
handleMsg:(NSString *)handleMsg
Expand Down
6 changes: 6 additions & 0 deletions OpenIMSDK/Interface/OIMManager+Message.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ NS_ASSUME_NONNULL_BEGIN
extension:(NSString * _Nullable)extension
description:(NSString * _Nullable)description;

/*
* 创建动图消息
*
*/
+ (OIMMessageInfo *)createFaceMessageWithIndex:(NSInteger)index
data:(NSString *)dataStr;
@end

@interface OIMManager (Message)
Expand Down
9 changes: 8 additions & 1 deletion OpenIMSDK/Interface/OIMManager+Message.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ + (OIMMessageInfo *)createMergeMessage:(NSArray<OIMMessageInfo *> *)messages
summaryList:(NSArray<NSString *> *)summarys {
NSArray *msgs = [OIMMessageInfo mj_keyValuesArrayWithObjectArray:messages];
NSString *json = Open_im_sdkCreateMergerMessage([OIMManager.manager operationId], [[NSString alloc]initWithData:[NSJSONSerialization dataWithJSONObject:msgs options:0 error:nil] encoding:NSUTF8StringEncoding], title, summarys.mj_JSONString);

return [self convertToMessageInfo:json];
}

Expand Down Expand Up @@ -136,6 +136,13 @@ + (OIMMessageInfo *)createCustomMessage:(NSString *)data
return [self convertToMessageInfo:json];
}

+ (OIMMessageInfo *)createFaceMessageWithIndex:(NSInteger)index
data:(NSString *)dataStr {
NSString *json = Open_im_sdkCreateFaceMessage([OIMManager.manager operationId], index, dataStr);

return [self convertToMessageInfo:json];
}

@end

@implementation OIMManager (Message)
Expand Down
1 change: 0 additions & 1 deletion OpenIMSDK/Model/OIMAtElem.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ NS_ASSUME_NONNULL_BEGIN
/*
* at 消息内容
*/

@property (nonatomic, nullable, copy) NSString *text;

/*
Expand Down
19 changes: 19 additions & 0 deletions OpenIMSDK/Model/OIMFaceElem.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// OIMFaceElem.h
// OpenIMSDK
//
// Created by x on 2022/3/9.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface OIMFaceElem : NSObject

@property (nonatomic, assign) NSInteger index;

@property (nonatomic, nullable, copy) NSString *data;
@end

NS_ASSUME_NONNULL_END
12 changes: 12 additions & 0 deletions OpenIMSDK/Model/OIMFaceElem.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
//
// OIMFaceElem.m
// OpenIMSDK
//
// Created by x on 2022/3/9.
//

#import "OIMFaceElem.h"

@implementation OIMFaceElem

@end
1 change: 0 additions & 1 deletion OpenIMSDK/Model/OIMLocationElem.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#import "OIMLocationElem.h"

@implementation OIMLocationElem
@synthesize description;

+ (NSDictionary *)mj_replacedKeyFromPropertyName {
return @{@"desc" : @"description"};
Expand Down
4 changes: 3 additions & 1 deletion OpenIMSDK/Model/OIMMessageInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#import "OIMCustomElem.h"
#import "OIMQuoteElem.h"
#import "OIMNotificationElem.h"

#import "OIMFaceElem.h"
#import "OIMModelDefine.h"

NS_ASSUME_NONNULL_BEGIN
Expand Down Expand Up @@ -91,6 +91,8 @@ NS_ASSUME_NONNULL_BEGIN

@property (nonatomic, nullable, strong) OIMNotificationElem *notificationElem;

@property (nonatomic, nullable, strong) OIMFaceElem *faceElem;

@end

NS_ASSUME_NONNULL_END

0 comments on commit 218c3de

Please sign in to comment.