1. 本地通知 iOS10.0
1.1. 发送推送通知
//
// ViewController.m
// iOS10.0本地推送通知
//
// Created by zhouyu on 2017/12/28.
// Copyright © 2017年 zhouyu. All rights reserved.
//
#import "ViewController.h"
#import <UserNotifications/UserNotifications.h>
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"ios10.0之后本地通知";
[self setUpUI];
}
//- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
// // 使用 UNUserNotificationCenter 来管理通知
// UNUserNotificationCenter* center = [UNUserNotificationCenter currentNotificationCenter];
//
// //需创建一个包含待通知内容的 UNMutableNotificationContent 对象,注意不是 UNNotificationContent ,此对象为不可变对象。
// UNMutableNotificationContent* content = [[UNMutableNotificationContent alloc] init];
// content.title = [NSString localizedUserNotificationStringForKey:@"本地推送Title" arguments:nil];
// content.body = [NSString localizedUserNotificationStringForKey:@"本地推送Body" arguments:nil];
// content.sound = [UNNotificationSound defaultSound];
//
// // 在 设定时间 后推送本地推送
// UNTimeIntervalNotificationTrigger* trigger = [UNTimeIntervalNotificationTrigger
// triggerWithTimeInterval:5 repeats:NO];
//