
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to check which notifications are active in status bar in iOS?
To get the list of notifications which are active on your status bar tray we are going to use getdeliverednotifications, you can read more about it here.
https://developer.apple.com/documentation/usernotifications/unusernotificationcenter
While it is know that we cannot get the notifications from all apps as that would be a privacy violation, but we can get the notification for our application
Apple provide getDeliveredNotifications(completionHandler:)
Which returns a list of the app’s notifications that are still displayed in Notification Center.
You can write the following code depending upon your need.
UNUserNotificationCenter.current().getDeliveredNotifications { (notifications) in print(notifications) }
Advertisements