//
//  AppDelegate+ThirdParty.m
//  fastservice
//
//  Created by xuning on 2/29/24.
//  Copyright © 2024 FastService. All rights reserved.
//

#import "AppDelegate+ThirdParty.h"
#import <IQKeyboardManager/IQKeyboardManager.h>

@interface AppDelegate(ThirdParty)
//<BMKGeneralDelegate,BMKLocationAuthDelegate>


@end

@implementation AppDelegate (ThirdParty)
-(void)thirdPartyConfig:(UIApplication *)application WithOption:(NSDictionary *)launchOptions {
    
    [self setupIQKeyboard];
//    [self setupMapConfig];
}

- (void)setupIQKeyboard {
    
    // 禁用IQKeyboardManager的自动工具条
    [IQKeyboardManager sharedManager].enableAutoToolbar = NO;
    //键盘和上面的占位提示框之间又一点间距,会很难看
    [[IQKeyboardManager sharedManager]setKeyboardDistanceFromTextField:0];
    
    [IQKeyboardManager sharedManager].shouldResignOnTouchOutside = YES;
    
}
//- (void)setupMapConfig {
//    
//    // 地图
//    _mapManager = [[BMKMapManager alloc]init];
//    BOOL ret = [_mapManager start:BAIDU_APPKEY generalDelegate:self];
//    if(!ret){
//        Log(@"哎呦，百度地图没有注册成功哦~");
//    }
//    
//    // 定位
//    [[BMKLocationAuth sharedInstance] checkPermisionWithKey:BAIDU_APPKEY authDelegate:self];
//    
//    // 导航
//    [BNaviService_Instance initNaviService:nil success:^{
//        [BNaviService_Instance authorizeNaviAppKey:BAIDU_APPKEY
//                                        completion:^(BOOL suc) {
//            Log(@"authorizeNaviAppKey ret = %d",suc);
//        }];
//        
//    } fail:^{
//        Log(@"哎呦，百度地图导航没有注册成功哦~");
//    }];
//}
- (void)onGetNetworkState:(int)iError{
    if (0 == iError) {
        DebugLog(@"联网成功");
    }else{
        DebugLog(@"onGetNetworkState %d",iError);
    }
}

- (void)onGetPermissionState:(int)iError{
    if (0 == iError) {
        DebugLog(@"授权成功");
    }else {
        DebugLog(@"onGetPermissionState %d",iError);
    }
}
@end
