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
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
13 deletions
+21
-13
AppDelegate.m
OffcnIMSDKiOS/AppDelegate.m
+9
-8
OffcnIMSDKiOS.h
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSDKiOS.h
+5
-3
OffcnIMSDKiOS.m
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSDKiOS.m
+7
-2
No files found.
OffcnIMSDKiOS/AppDelegate.m
View file @
e3871fa2
...
...
@@ -31,18 +31,19 @@
//中公直播使用测试环境设置为YES,正式环境设置为NO或者去掉这个配置
NSNumber
*
changeEnvironment
=
[[
NSUserDefaults
standardUserDefaults
]
valueForKey
:
kOffcnIMSDKiOS_changeEnvironment
];
NSLog
(
@"changeEnvironment---%@"
,
changeEnvironment
);
[
OffcnIMSDKiOS
defaultService
].
isTest
=
[
changeEnvironment
boolValue
];
//
NSNumber *changeEnvironment = [[NSUserDefaults standardUserDefaults] valueForKey:kOffcnIMSDKiOS_changeEnvironment];
//
NSLog(@"changeEnvironment---%@",changeEnvironment);
//
[OffcnIMSDKiOS defaultService].isTest = [changeEnvironment boolValue];
//
获取用户相关数据库,该方法在登陆或者第一次启动已登陆下执行
[[
OffcnIM
ZYJFMDBHandler
sharedInstance
]
getUserDB
];
//
启动SDK
[[
OffcnIM
SDKiOS
defaultService
]
setupWithIsTest
:
YES
];
//推送
[
AppDelegate
registerOffcnUserNotificationSettingsWithApplication
:
application
options
:
launchOptions
];
//获取网络状态和内部初始化处理
[[
OffcnIMSDKiOS
defaultService
]
startNotifierUseRealReachability
];
//获取用户相关数据库,该方法在登陆或者第一次启动已登陆下执行
[[
OffcnIMZYJFMDBHandler
sharedInstance
]
getUserDB
];
return
YES
;
}
...
...
OffcnIMSDKiOS/ExposedInterface-(外放接口)/OffcnIMSDKiOS.h
View file @
e3871fa2
//
//
...
...
@@ -52,8 +52,10 @@ typedef void(^OffcnSDKReachabilityStatusCallBack)(OffcnSDKReachabilityStatus sta
@property
(
nonatomic
,
assign
)
OffcnSDKReachabilityStatus
OffcnReachabilityStatus
;
@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;
}
_isTest
=
isTest
;
}
-
(
void
)
setupWithIsTest
:
(
BOOL
)
isTest
{
self
.
isTest
=
isTest
;
//获取网络状态和内部初始化处理
[
self
startNotifierUseRealReachability
];
}
#pragma mark - 使用RealReachability监听网络状态
-
(
void
)
startNotifierUseRealReachability
{
[[
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