-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathAppDelegate.m
65 lines (48 loc) · 2.15 KB
/
AppDelegate.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
//
// AppDelegate.m
// QCFrameworkDemo
//
//
#import "AppDelegate.h"
#import "TIoTCoreFoundation.h"
#import "TIoTCoreAppEnvironment.h"
#import "TIoTDemoWebSocketManager.h"
#import "TIoTCoreServices.h"
#import "TIoTPrintLogManager.h"
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
/*
* 此处仅供参考, 需自建服务接入物联网平台服务,以免 App Secret 泄露
* 自建服务可参考此处 https://cloud.tencent.com/document/product/1081/45901#.E6.90.AD.E5.BB.BA.E5.90.8E.E5.8F.B0.E6.9C.8D.E5.8A.A1.2C-.E5.B0.86-app-api-.E8.B0.83.E7.94.A8.E7.94.B1.E8.AE.BE.E5.A4.87.E7.AB.AF.E5.8F.91.E8.B5.B7.E5.88.87.E6.8D.A2.E4.B8.BA.E7.94.B1.E8.87.AA.E5.BB.BA.E5.90.8E.E5.8F.B0.E6.9C.8D.E5.8A.A1.E5.8F.91.E8.B5.B7
*/
TIoTCoreAppEnvironment *environment = [TIoTCoreAppEnvironment shareEnvironment];
[environment setEnvironment];
// [[TIoTDemoWebSocketManager shared] SRWebSocketOpen];
environment.appKey = @"物联网开发平台申请的 App Key";
environment.appSecret = @"物联网开发平台申请的 App Secret";
/**
* 此处若接入腾讯云物理网智能视频服务,则需要进行相关注册后,获取以下信息
* 参考连接
* https://cloud.tencent.com/product
*/
environment.cloudSecretId = @"";
environment.cloudSecretKey = @"";
environment.cloudProductId = @"";
//开启打印日志
[TIoTCoreServices shared].logEnable = true;
//打印日志配
[[TIoTPrintLogManager sharedManager] config];
[[TIoTPrintLogManager sharedManager] setLogLevel:ddLogLevel];
if (![TIoTCoreUserManage shared].isValidToken) {
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:[NSClassFromString(@"TIoTMainVC") new]];
}
return YES;
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
[[NSNotificationCenter defaultCenter] postNotificationName:@"EnterForeground" object:nil];
}
@end