IOS10 本地推送通知实战

2018-05-15  本文已影响40人  FengxinLi

网上有很多资料关于IOS10推送的理论知识,下面我用代码加效果截图的方式来加深印象。
当我们在app前台的时候,我们通知栏是不会显示的。但是ios10提供了方法给我们可以在前台的时候,弹出通知栏。
那就是需要设置
[UNUserNotificationCenter currentNotificationCenter].delegate = self;
并且实现代理方法。

// The method will be called on the delegate when the user responded to the notification by opening the application, dismissing the notification or choosing a UNNotificationAction. The delegate must be set before the application returns from application:didFinishLaunchingWithOptions:.

6带音频的通知


6666.gif

下面是代码
https://github.com/lijufengxin/UserLocalNotificationDemo

上一篇 下一篇

猜你喜欢

热点阅读