iOS 本地通知推送 iOS10.0 新API使用总结

1. 本地通知 iOS10.0本地通知 iOS10.0demo下载链接iOS8.0 本地推送通知和接收通知及其跳转控制总结 1.1. 发送推送通知 //// ViewController.m// iOS10.0本地推送通知//// Created by zhouyu on 2017/12/28.// Copyright © 2017年 zhouyu. All rights rese
摘要由CSDN通过智能技术生成

1. 本地通知 iOS10.0

本地通知 iOS10.0demo下载链接

iOS8.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];
//
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值