首页 > 移动平台 > 详细

移动端通知

时间:2016-10-06 00:15:26      阅读:206      评论:0      收藏:0      [点我收藏+]

步骤:

1. 添加框架 UserNotifications

2. 注册远程通知

let center = UNUserNotificationCenter.current()
    center.requestAuthorization(options: [.alert, .sound, .badge]) { (granted, error) in

        // Enable or disable features based on authorization.
        if granted == true
        {
            print("Allow")
            UIApplication.shared.registerForRemoteNotifications()
        }
        else
        {
            print("Don‘t Allow")
        }
    }

3. 获取Token

 

移动端通知

原文:http://www.cnblogs.com/jackyzhong123/p/5933205.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!