- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification*)notification{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"iWeibo" message:notification.alertBody delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];
[alert show];
// 图标上的数字减1
application.applicationIconBadgeNumber -= 1;
}
UILocalNotification *notification = [[UILocalNotification alloc] init];
// 设置推送时间
notification.fireDate = [NSDate dateWithTimeIntervalSinceNow:0];
// 设置时区
notification.timeZone = [NSTimeZone defaultTimeZone];
// 设置重复间隔
// notification.repeatInterval = kCFCalendarUnitDay;
// 推送声音
notification.soundName = UILocalNotificationDefaultSoundName;
// 推送内容
notification.alertBody = msg;
//显示在icon上的红色圈中的数子
notification.applicationIconBadgeNumber += 1;
//设置userinfo 方便在之后使用
notification.userInfo = para;
//添加推送到UIApplication
UIApplication *app = [UIApplication sharedApplication];
[app scheduleLocalNotification:notification];