AppDelegate+JMessage.m 1.08 KB
Newer Older
李晓兵's avatar
李晓兵 committed
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
//
//  AppDelegate+JPush.m
//  delegateExtention
//
//  Created by 张庆贺 on 15/8/3.
//  Copyright (c) 2015年 JPush. All rights reserved.
//

#import <objc/runtime.h>
#import <AdSupport/AdSupport.h>
#import "JMessagePlugin.h"
#import "JMessageHelper.h"
#import "AppDelegate+JMessage.h"


@implementation AppDelegate (JMessage)

+(void)load{
    Method origin1;
    Method swizzle1;
    origin1  = class_getInstanceMethod([self class],@selector(init));
    swizzle1 = class_getInstanceMethod([self class], @selector(init_plus1));
    method_exchangeImplementations(origin1, swizzle1);
}

-(instancetype)init_plus1{
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidLaunch1:) name:UIApplicationDidFinishLaunchingNotification object:nil];
    return [self init_plus1];
}

NSDictionary *_launchOptions;

-(void)applicationDidLaunch1:(NSNotification *)notification{
    [self startJMessageSDK];
}

-(void)startJMessageSDK{
//  [[JMessageHelper shareInstance] initJMessage:_launchOptions];
  [JMessageHelper shareInstance].launchOptions = _launchOptions;

  
}

@end