From c2babc3a396a00ea1d02753ee26ca31b6551ac41 Mon Sep 17 00:00:00 2001 From: "E.B" <57380422@qq.com> Date: Mon, 21 Mar 2016 15:30:16 +0800 Subject: [PATCH] =?UTF-8?q?iOS-=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1.AppDelegate+JPush.m中不再使用runtime --- src/ios/Plugins/AppDelegate+JPush.m | 30 ++++++++++------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/src/ios/Plugins/AppDelegate+JPush.m b/src/ios/Plugins/AppDelegate+JPush.m index b52c0ba..5bee122 100644 --- a/src/ios/Plugins/AppDelegate+JPush.m +++ b/src/ios/Plugins/AppDelegate+JPush.m @@ -9,30 +9,20 @@ #import "AppDelegate+JPush.h" #import "JPushPlugin.h" #import "JPUSHService.h" -#import @implementation AppDelegate (JPush) -+(void)load{ - Method origin; - Method swizzle; - origin=class_getInstanceMethod([self class],@selector(init)); - swizzle=class_getInstanceMethod([self class], @selector(init_plus)); - method_exchangeImplementations(origin, swizzle); -} +-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ + [JPushPlugin setLaunchOptions:launchOptions]; --(instancetype)init_plus{ - [[NSNotificationCenter defaultCenter] addObserver:self - selector:@selector(applicationDidLaunch:) - name:@"UIApplicationDidFinishLaunchingNotification" - object:nil]; - return [self init_plus]; -} - --(void)applicationDidLaunch:(NSNotification*)notification{ - if (notification) { - [JPushPlugin setLaunchOptions:notification.userInfo]; - } + //cordova didFinishLaunchingWithOptions + CGRect screenBounds = [[UIScreen mainScreen] bounds]; + self.window = [[UIWindow alloc] initWithFrame:screenBounds]; + self.viewController = [[CDVViewController alloc] init]; + self.window.rootViewController = self.viewController; + self.window.autoresizesSubviews = YES; + [self.window makeKeyAndVisible]; + return YES; } - (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken {