由于IOS10以后更新了通知的类。所以我们必须要学会判断当前设备的版本,ios10以前的设备仍然使用以前的写法。ios10以后使用新写法。如果还不会判断版本的。请参考上一篇微博:
http://blog.csdn.net/lee727n/article/details/72757831
发送本地通知代码及注释如下:
- (void)viewDidLoad {
[super viewDidLoad];
// ios10以前的写法:
// UILocalNotification *noti = [[UILocalNotification alloc]init];
// noti.userInfo = @{@"name":@"hehe"};
//
// noti.repeatInterval = NSCalendarUnitMinute;
//
// noti.alertBody = @"lalala b