Commit e3871fa2 by zhangyunjie

启动SDK方法

parent 81650ebe
......@@ -31,17 +31,18 @@
//中公直播使用测试环境设置为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];
//获取用户相关数据库,该方法在登陆或者第一次启动已登陆下执行
[[OffcnIMZYJFMDBHandler sharedInstance] getUserDB];
//启动SDK
[[OffcnIMSDKiOS defaultService] setupWithIsTest:YES];
//推送
[AppDelegate registerOffcnUserNotificationSettingsWithApplication:application options:launchOptions];
//获取网络状态和内部初始化处理
[[OffcnIMSDKiOS defaultService] startNotifierUseRealReachability];
//获取用户相关数据库,该方法在登陆或者第一次启动已登陆下执行
[[OffcnIMZYJFMDBHandler sharedInstance] getUserDB];
return YES;
}
......
//
//
......@@ -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;
/// 发送消息
......
//
//
......@@ -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];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment