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
| [GizWifiSDK shareInstance].delegate = self;
[GizWifiSDK startWithAppID"your_app_id"];
// 实现系统事件通知回调
- (void)wifiSDKGizWifiSDK *)wifiSDK didNotifyEventGizEventType)eventType eventSourceid)eventSource eventIDGizWifiErrorCode)eventID eventMessage: (NSString *)eventMessage {
if(eventType == GizEventSDK)
{
// SDK发生异常的通知
NSLog(@"SDK event happened: [%@] = %@", @(eventID), eventMessage);
}
else if(eventType == GizEventDevice)
{
// 设备连接断开时可能产生的通知
GizWifiDevice* mDevice = (GizWifiDevice*)eventSource;
NSLog(@"device mac %@ disconnect caused by %@", mDevice.macAddress, eventMessage);
}
else if(eventType == GizEventM2MService)
{
// M2M服务返回的异常通知
NSLog(@"M2M domain %@ exception happened: [%@] = %@", (NSString*)eventSource, @(eventID), eventMessage);
}
else if(eventType == GizEventToken)
{
// token失效通知
NSLog(@"token %@ expired: %@", (NSString*)eventSource, eventMessage);
}
|