4
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
#import "AppDelegate.h"
|
||||
#import "ViewController.h"
|
||||
#import "KBPermissionViewController.h"
|
||||
|
||||
#import <AFNetworking/AFNetworking.h>
|
||||
#import <Bugly/Bugly.h>
|
||||
static NSString * const kKBKeyboardExtensionBundleId = @"com.keyBoard.CustomKeyboard";
|
||||
static BOOL KBIsKeyboardEnabled(void) {
|
||||
for (UITextInputMode *mode in [UITextInputMode activeInputModes]) {
|
||||
@@ -37,24 +38,15 @@ static BOOL KBIsKeyboardEnabled(void) {
|
||||
[self.window makeKeyAndVisible];
|
||||
ViewController *vc = [[ViewController alloc] init];
|
||||
self.window.rootViewController = vc;
|
||||
|
||||
// [[NSNotificationCenter defaultCenter] addObserver:self
|
||||
// selector:@selector(applicationDidBecomeActiveNotification:)
|
||||
// name:UIApplicationDidBecomeActiveNotification
|
||||
// object:nil];
|
||||
|
||||
/// 获取网络权限
|
||||
[self getNetJudge];
|
||||
[Bugly startWithAppId:BuglyId];
|
||||
/// 判断获取键盘权限
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self kb_presentPermissionIfNeeded];
|
||||
});
|
||||
return YES;
|
||||
}
|
||||
//
|
||||
//#pragma mark - Active notifications
|
||||
//
|
||||
//- (void)applicationDidBecomeActiveNotification:(NSNotification *)note
|
||||
//{
|
||||
// [self kb_presentPermissionIfNeeded];
|
||||
//}
|
||||
|
||||
#pragma mark - Permission presentation
|
||||
|
||||
@@ -87,4 +79,20 @@ static BOOL KBIsKeyboardEnabled(void) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
-(void)getNetJudge {
|
||||
AFNetworkReachabilityManager *netManager = [AFNetworkReachabilityManager sharedManager];
|
||||
[netManager startMonitoring];
|
||||
[netManager setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status){
|
||||
if (status == AFNetworkReachabilityStatusReachableViaWiFi){
|
||||
// [PublicObj saveNetReachability:@"wifi"];
|
||||
}else if (status == AFNetworkReachabilityStatusReachableViaWWAN){
|
||||
// [PublicObj saveNetReachability:@"wwan"];
|
||||
}else{
|
||||
// [PublicObj saveNetReachability:@"unknown"];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user