| | |
| | | #import "ViewController.h" |
| | | #import "EZSupportViewController.h" |
| | | #import "DDKit.h" |
| | | #import "EZSDK.h" |
| | | #import "MBProgressHUD.h" |
| | | |
| | | @interface ViewController () |
| | | @property (weak, nonatomic) IBOutlet UIButton *ddnsDemoBtn; |
| | |
| | | self.ddnsDemoBtn.hidden = YES; |
| | | #endif |
| | | // Do any additional setup after loading the view, typically from a nib. |
| | | |
| | | |
| | | } |
| | | |
| | | - (void)didReceiveMemoryWarning { |
| | |
| | | // //push摄像头列表的viewController |
| | | // [self.navigationController pushViewController:instanceVC animated:YES]; |
| | | |
| | | [[GlobalKit shareKit] setAccessToken:@"ra.b48ex6o495x0etj76a0a3huh1x91ymvw-8oi8f811ry-15pqyvo-dyuk9nyz4"]; |
| | | /** |
| | | * 下面代码功能与以上的注释方法相同 |
| | | */ |
| | |
| | | - (IBAction)logout:(id)sender |
| | | { |
| | | |
| | | [EZOPENSDK logout:^(NSError *error) { |
| | | // [EZOPENSDK logout:^(NSError *error) { |
| | | // }]; |
| | | |
| | | __weak MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; |
| | | [EZSDK addDeviceByHDL:@"" verifyCode:@"" completion:^(NSError *error) { |
| | | |
| | | [hud hide:YES]; |
| | | |
| | | if(!error){ |
| | | NSLog(@"请求成功"); |
| | | }else{ |
| | | NSLog(@"请求失败"); |
| | | |
| | | // NSLog(@"请求失败%@",error.description); |
| | | } |
| | | [self handleTheError:error]; |
| | | }]; |
| | | } |
| | | |
| | | - (void)handleTheError:(NSError *)error |
| | | { |
| | | if (!error) |
| | | { |
| | | // [self performSegueWithIdentifier:@"go2WifiResult" sender:nil]; |
| | | return; |
| | | } |
| | | if (error.code == 105002) |
| | | { |
| | | UIAlertView *retryAlertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"device_verify_code_wrong", @"验证码错误") message:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", @"取消") otherButtonTitles:NSLocalizedString(@"retry", @"重试"), nil]; |
| | | retryAlertView.tag = 0xbb; |
| | | [retryAlertView show]; |
| | | } |
| | | else if (error.code == 105000) |
| | | { |
| | | [UIView dd_showMessage:NSLocalizedString(@"ad_already_added",@"您已添加过此设备")]; |
| | | } |
| | | else if (error.code == 105001) |
| | | { |
| | | [UIView dd_showMessage:NSLocalizedString(@"ad_added_by_others",@"此设备已被别人添加")]; |
| | | } |
| | | else |
| | | { |
| | | [UIView dd_showMessage:NSLocalizedString(@"wifi_add_fail",@"添加失败")]; |
| | | } |
| | | } |
| | | |
| | | |
| | | - (IBAction)goAPI:(id)sender |
| | | { |
| | | [EZOPENSDK gotoEzvizAppPage:EZPageAlarmList appType:EZEzvizInternational]; |
| | | |
| | | |
| | | // [EZOPENSDK gotoEzvizAppPage:EZPageAlarmList appType:EZEzvizInternational]; |
| | | // [self performSegueWithIdentifier:@"go2DemoAPI" sender:nil]; |
| | | } |
| | | |