Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
OffcnIMSDKiOS
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
opensource
OffcnIMSDKiOS
Commits
53891b8c
Commit
53891b8c
authored
Sep 14, 2020
by
zhangyunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oimcore
parent
3e59e066
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
34 additions
and
19 deletions
+34
-19
project.pbxproj
OffcnIMSDKiOS.xcodeproj/project.pbxproj
+0
-0
OffcnIMSocketManager.h
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSocketManager.h
+3
-2
OffcnIMSocketManager.mm
...nIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSocketManager.mm
+22
-11
ViewController.m
OffcnIMSDKiOS/ViewController.m
+2
-0
oim_types.h
OffcnIMSDKiOS/oimcore.framework/Headers/oim_types.h
+3
-1
oimcoreAdapter.h
OffcnIMSDKiOS/oimcore.framework/Headers/oimcoreAdapter.h
+4
-5
oimcore
OffcnIMSDKiOS/oimcore.framework/oimcore
+0
-0
No files found.
OffcnIMSDKiOS.xcodeproj/project.pbxproj
View file @
53891b8c
This diff is collapsed.
Click to expand it.
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSocketManager.h
View file @
53891b8c
//
//
...
@@ -12,10 +12,11 @@
...
@@ -12,10 +12,11 @@
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
typedef
NS_ENUM
(
NSUInteger
,
OffcnIMConnectStatus
)
{
typedef
NS_ENUM
(
NSUInteger
,
OffcnIMConnectStatus
)
{
OffcnIMConnectStatusSuccess
,
//连接成功
OffcnIMConnectStatusSuccess
,
//连接成功
OffcnIMConnectStatusFail
,
//连接失败
OffcnIMConnectStatusFail
,
//连接失败
OffcnIMConnectStatusBreak
,
//连接断开
OffcnIMConnectStatusBreak
,
//连接断开
OffcnIMConnectStatusDisConnectOK
,
//手动断开成功
OffcnIMConnectStatusDisConnectOK
,
//手动断开成功
OffcnIMConnectStatusKickout
,
//互挤
};
};
//收到消息回调
//收到消息回调
...
...
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSocketManager.m
→
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSocketManager.m
m
View file @
53891b8c
//
//
...
@@ -165,30 +165,41 @@ static OffcnIMSocketManager *socketManager;
...
@@ -165,30 +165,41 @@ static OffcnIMSocketManager *socketManager;
}
}
}
}
//Z_CONN_IM_SRV_OK,连接成功
//typedef enum
//Z_CONN_IM_SRV_FAILED,连接失败
//{
//Z_CONN_IM_SRV_BROKEN,连接断开
// Z_CONN_IM_SRV_OK,
//Z_DISCONN_IM_SRV_OK,手动断开成功
// Z_CONN_IM_SRV_FAILED,
-
(
void
)
OnOImCoreEventWithCode
:
(
int
)
code
context
:
(
const
char
*
)
context
{
//
// Z_CONN_IM_SRV_BROKEN,
//
// Z_DISCONN_IM_SRV_OK,
//
// Z_CONN_IM_KICK_OUT, //±ªÃfl ≤ª–Ë“™÷ÿ¡¨
//
//}OImEventCode;
-
(
void
)
OnOImCoreEventWithCode
:
(
OImEventCode
)
code
context
:
(
const
char
*
_Nonnull
)
context
{
//连接状态
//连接状态
if
(
code
==
1
||
code
==
2
)
{
if
(
code
==
Z_CONN_IM_SRV_FAILED
||
code
==
Z_CONN_IM_SRV_BROKEN
||
code
==
Z_CONN_IM_KICK_OUT
)
{
[
self
.
adapter
DisConnectImServer
];
[
self
.
adapter
DisConnectImServer
];
}
}
if
(
self
.
connectStatus
)
{
if
(
self
.
connectStatus
)
{
NSString
*
message
=
[
NSString
stringWithUTF8String
:
context
];
NSString
*
message
=
[
NSString
stringWithUTF8String
:
context
];
if
(
code
==
0
)
{
if
(
code
==
Z_CONN_IM_SRV_OK
)
{
self
.
IMConnectStatus
=
OffcnIMConnectStatusSuccess
;
self
.
IMConnectStatus
=
OffcnIMConnectStatusSuccess
;
self
.
connectStatus
(
OffcnIMConnectStatusSuccess
,
message
);
self
.
connectStatus
(
OffcnIMConnectStatusSuccess
,
message
);
}
else
if
(
code
==
1
){
}
else
if
(
code
==
Z_CONN_IM_SRV_FAILED
){
self
.
IMConnectStatus
=
OffcnIMConnectStatusFail
;
self
.
IMConnectStatus
=
OffcnIMConnectStatusFail
;
self
.
connectStatus
(
OffcnIMConnectStatusFail
,
message
);
self
.
connectStatus
(
OffcnIMConnectStatusFail
,
message
);
}
else
if
(
code
==
2
){
}
else
if
(
code
==
Z_CONN_IM_SRV_BROKEN
){
self
.
IMConnectStatus
=
OffcnIMConnectStatusBreak
;
self
.
IMConnectStatus
=
OffcnIMConnectStatusBreak
;
self
.
connectStatus
(
OffcnIMConnectStatusBreak
,
message
);
self
.
connectStatus
(
OffcnIMConnectStatusBreak
,
message
);
}
else
if
(
code
==
3
){
}
else
if
(
code
==
Z_DISCONN_IM_SRV_OK
){
self
.
IMConnectStatus
=
OffcnIMConnectStatusDisConnectOK
;
self
.
IMConnectStatus
=
OffcnIMConnectStatusDisConnectOK
;
self
.
connectStatus
(
OffcnIMConnectStatusDisConnectOK
,
message
);
self
.
connectStatus
(
OffcnIMConnectStatusDisConnectOK
,
message
);
}
else
if
(
code
==
Z_CONN_IM_KICK_OUT
){
self
.
IMConnectStatus
=
OffcnIMConnectStatusKickout
;
self
.
connectStatus
(
OffcnIMConnectStatusKickout
,
message
);
}
}
}
}
}
}
...
...
OffcnIMSDKiOS/ViewController.m
m
→
OffcnIMSDKiOS/ViewController.m
View file @
53891b8c
...
@@ -108,6 +108,8 @@
...
@@ -108,6 +108,8 @@
errorMessage
=
@"连接失败,请重新连接"
;
errorMessage
=
@"连接失败,请重新连接"
;
}
else
if
(
status
==
OffcnIMConnectStatusBreak
){
}
else
if
(
status
==
OffcnIMConnectStatusBreak
){
errorMessage
=
@"连接断开,请重新连接"
;
errorMessage
=
@"连接断开,请重新连接"
;
}
else
if
(
status
==
OffcnIMConnectStatusKickout
){
errorMessage
=
@"被挤掉"
;
}
}
[
weakSelf
tipMessageWithTitle
:
@"收到连接状态"
message
:
errorMessage
];
[
weakSelf
tipMessageWithTitle
:
@"收到连接状态"
message
:
errorMessage
];
};
};
...
...
OffcnIMSDKiOS/oimcore.framework/Headers/oim_types.h
View file @
53891b8c
...
@@ -43,13 +43,15 @@ namespace im
...
@@ -43,13 +43,15 @@ namespace im
Z_CONN_IM_SRV_BROKEN
,
Z_CONN_IM_SRV_BROKEN
,
Z_DISCONN_IM_SRV_OK
,
Z_DISCONN_IM_SRV_OK
,
Z_CONN_IM_KICK_OUT
,
//被踢 不需要重连
}
OImEventCode
;
}
OImEventCode
;
class
OImCoreObserver
class
OImCoreObserver
{
{
public
:
public
:
virtual
void
OnOImCoreEvent
(
int
code
,
const
char
*
context
)
=
0
;
virtual
void
OnOImCoreEvent
(
OImEventCode
code
,
const
char
*
context
)
=
0
;
virtual
void
OnOImCoreMessage
(
const
char
*
message
,
int
len
)
=
0
;
virtual
void
OnOImCoreMessage
(
const
char
*
message
,
int
len
)
=
0
;
};
};
}
}
...
...
OffcnIMSDKiOS/oimcore.framework/Headers/oimcoreAdapter.h
View file @
53891b8c
...
@@ -7,16 +7,15 @@
...
@@ -7,16 +7,15 @@
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <UIKit/UIKit.h>
#import "oim_types.h"
using
namespace
offcn
::
im
;
@protocol
OIMCoreDelegate
<
NSObject
>
@protocol
OIMCoreDelegate
<
NSObject
>
-
(
void
)
OnOImCoreMessageWithMessage
:
(
const
char
*
_Nonnull
)
message
msgLength
:
(
int
)
len
;
-
(
void
)
OnOImCoreMessageWithMessage
:
(
const
char
*
_Nonnull
)
message
msgLength
:
(
int
)
len
;
-
(
void
)
OnOImCoreEventWithCode
:(
int
)
code
context
:(
const
char
*
_Nonnull
)
context
;
-
(
void
)
OnOImCoreEventWithCode
:(
OImEventCode
)
code
context
:(
const
char
*
_Nonnull
)
context
;
@end
@end
typedef
NS_ENUM
(
NSInteger
,
OImMsgType
)
{
kMsg_Type_Normal
,
//正常的聊天消息
kMsg_Type_Recv_Confirm
,
//收到服务端发来的消息确认消息
};
NS_ASSUME_NONNULL_BEGIN
NS_ASSUME_NONNULL_BEGIN
...
...
OffcnIMSDKiOS/oimcore.framework/oimcore
View file @
53891b8c
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment