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
e3871fa2
Commit
e3871fa2
authored
Sep 14, 2020
by
zhangyunjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
启动SDK方法
parent
81650ebe
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
11 deletions
+19
-11
AppDelegate.m
OffcnIMSDKiOS/AppDelegate.m
+8
-7
OffcnIMSDKiOS.h
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSDKiOS.h
+5
-3
OffcnIMSDKiOS.m
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSDKiOS.m
+6
-1
No files found.
OffcnIMSDKiOS/AppDelegate.m
View file @
e3871fa2
...
@@ -31,17 +31,18 @@
...
@@ -31,17 +31,18 @@
//中公直播使用测试环境设置为YES,正式环境设置为NO或者去掉这个配置
//中公直播使用测试环境设置为YES,正式环境设置为NO或者去掉这个配置
NSNumber
*
changeEnvironment
=
[[
NSUserDefaults
standardUserDefaults
]
valueForKey
:
kOffcnIMSDKiOS_changeEnvironment
];
//
NSNumber *changeEnvironment = [[NSUserDefaults standardUserDefaults] valueForKey:kOffcnIMSDKiOS_changeEnvironment];
NSLog
(
@"changeEnvironment---%@"
,
changeEnvironment
);
//
NSLog(@"changeEnvironment---%@",changeEnvironment);
[
OffcnIMSDKiOS
defaultService
].
isTest
=
[
changeEnvironment
boolValue
];
//
[OffcnIMSDKiOS defaultService].isTest = [changeEnvironment boolValue];
//
获取用户相关数据库,该方法在登陆或者第一次启动已登陆下执行
//
启动SDK
[[
OffcnIM
ZYJFMDBHandler
sharedInstance
]
getUserDB
];
[[
OffcnIM
SDKiOS
defaultService
]
setupWithIsTest
:
YES
];
//推送
//推送
[
AppDelegate
registerOffcnUserNotificationSettingsWithApplication
:
application
options
:
launchOptions
];
[
AppDelegate
registerOffcnUserNotificationSettingsWithApplication
:
application
options
:
launchOptions
];
//获取网络状态和内部初始化处理
//获取用户相关数据库,该方法在登陆或者第一次启动已登陆下执行
[[
OffcnIMSDKiOS
defaultService
]
startNotifierUseRealReachability
];
[[
OffcnIMZYJFMDBHandler
sharedInstance
]
getUserDB
];
return
YES
;
return
YES
;
}
}
...
...
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSDKiOS.h
View file @
e3871fa2
//
//
...
@@ -52,8 +52,10 @@ typedef void(^OffcnSDKReachabilityStatusCallBack)(OffcnSDKReachabilityStatus sta
...
@@ -52,8 +52,10 @@ typedef void(^OffcnSDKReachabilityStatusCallBack)(OffcnSDKReachabilityStatus sta
@property
(
nonatomic
,
assign
)
OffcnSDKReachabilityStatus
OffcnReachabilityStatus
;
@property
(
nonatomic
,
assign
)
OffcnSDKReachabilityStatus
OffcnReachabilityStatus
;
@property
(
nonatomic
,
copy
)
OffcnSDKReachabilityStatusCallBack
reachabilityStatusCallBack
;
@property
(
nonatomic
,
copy
)
OffcnSDKReachabilityStatusCallBack
reachabilityStatusCallBack
;
//监听网络状态
-
(
void
)
startNotifierUseRealReachability
;
/// 启动SDK
/// @param isTest 是否选用测试环境
-
(
void
)
setupWithIsTest
:(
BOOL
)
isTest
;
/// 发送消息
/// 发送消息
...
...
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSDKiOS.m
View file @
e3871fa2
//
//
...
@@ -49,7 +49,12 @@ static OffcnIMSDKiOS *liveTelecastSDK;
...
@@ -49,7 +49,12 @@ static OffcnIMSDKiOS *liveTelecastSDK;
}
}
_isTest
=
isTest
;
_isTest
=
isTest
;
}
}
-
(
void
)
setupWithIsTest
:
(
BOOL
)
isTest
{
self
.
isTest
=
isTest
;
//获取网络状态和内部初始化处理
[
self
startNotifierUseRealReachability
];
}
#pragma mark - 使用RealReachability监听网络状态
#pragma mark - 使用RealReachability监听网络状态
-
(
void
)
startNotifierUseRealReachability
{
-
(
void
)
startNotifierUseRealReachability
{
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
networkChanged
:
)
name
:
ZYJkRealReachabilityChangedNotification
object
:
nil
];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
networkChanged
:
)
name
:
ZYJkRealReachabilityChangedNotification
object
:
nil
];
...
...
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