IOS 8本地推送补充

<强> -

<强> - (BOOL)应用程序:(UIApplication  *)应用didFinishLaunchingWithOptions: (NSDictionary  *) launchOptions{

<强>,//覆盖点才能定制应用程序启动后。

<强>,_window 才能=[[UIWindow  alloc] initWithFrame: [UIScreen  mainScreen] .bounds];

<强>,_window.backgroundColor 才能=[UIColor  whiteColor];

<强>,,[_window  makeKeyAndVisible];

<强>,ScrollContentViewController 才能;* scrollcontentView=[[ScrollContentViewController  alloc] init];

<强>,UINavigationController 才能;*导航控制器=[[UINavigationController  alloc] initWithRootViewController: scrollcontentView];

<强>,_window.rootViewController 才能=导航控制器;

<强>,UIView 才能;* statusBarView=[[UIView  alloc] initWithFrame: CGRectMake(0, -20,, 320,, 64)];

<强>,,statusBarView.backgroundColor =[UIColor  colorWithRed: 0,格林:122/255.0f 蓝色:247/255.0f α:1];

<强>,,[navigationController.navigationBar  addSubview: statusBarView];


<强>,,[application  setStatusBarHidden:没有),

<强>,,[application  setStatusBarStyle: UIStatusBarStyleLightContent];

<强>,,,// <强> ios 8

<强>,if 才能;([UIApplication  instancesRespondToSelector: @ selector (registerUserNotificationSettings:)))

<强>,,{

<强>,,,,[[UIApplication ,, sharedApplication] registerUserNotificationSettings: [UIUserNotificationSettingssettingsForTypes: UIUserNotificationTypeAlert  | UIUserNotificationTypeBadge  |, UIUserNotificationTypeSound 类:零]],

<强>,,}


<强>,return 才能;是的;


<强>},

<强> - (void)应用范围:(UIApplication  *)应用didReceiveLocalNotification: (UILocalNotification  *)通知

<强>{

<强>,,,//

<强>,NSLog才能(@ % @”、通知);

<强>,UIAlertView 才能;*警报=[[UIAlertView  alloc] initWithTitle: @“iWeibo”,信息:notification.alertBody 委托:nil  cancelButtonTitle: @” <强>”otherButtonTitles:, nil);

<强>,,[alert 显示];

<强>,,,// <强> 1

<强>,,application.applicationIconBadgeNumber  -=1;

<强>,,,

<强>,,,//

<强>,//强才能uiapplication <强>

<强>,UIApplication 才能;*应用=[UIApplication  sharedApplication];

<强>,NSArray 才能;* localArray=[app  scheduledLocalNotifications];

<强>,UILocalNotification 才能;* localNotification;

<强>,if 才能;(localArray)

<强>,,{

<强>,,,for 才能;(UILocalNotification  * noti 拷贝;localArray)

<强>,,,,{

<强>,,,,,NSDictionary 才能;* dict=noti.userInfo;

<强>,,,,,if 才能;(dict)

<强>,,,,,,{

<强>,,,,,,,NSString 才能;* inKey=(dict  objectForKey: @“关键”);

<强>,,,,,,,if 才能;([inKey  isEqualToString: @” <强>键 <>强"])

<强>,,,,,,,,{

<强>,,,,,,,,,if 才能;(localNotification)

<强>,,,,,,,,,,{

<强>,,,,,,,,,,,,localNotification=, nil;

<强>,,,,,,,,,,}

<强>,,,null

IOS 8本地推送补充