iOS - Local notifications - cancelAllLocalNotifications

情到浓时终转凉″ 提交于 2019-12-22 09:50:56

问题


May be a simple question: When I call "cancelAllLocalNotifications", does it cancel notifications created by the app only or it will cancel all notifications from other apps also?


回答1:


The notifications created by other apps will not be affected.

From: Local and Push Notification Programming Guide

"You can cancel a specific scheduled notification by calling cancelLocalNotification: on the application object, and you can cancel all scheduled notifications by calling cancelAllLocalNotifications."

Although, this is probably not the best written sentence, the "on the application object" applies to cancelAllLocalNotifications as well as cancelLocalNotification.

Hope that helps!



来源:https://stackoverflow.com/questions/8033690/ios-local-notifications-cancelalllocalnotifications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!