Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does iOS have a 'Notification Listener'?

Is it possible to create a Notification Listener in iOS? Something like the NotificationListenerService in Android.

Edit: What I want to do is listen to any notifications coming from any app within the device (missed calls, emails, SMS...)

like image 247
Markus Dressel Avatar asked Feb 27 '14 16:02

Markus Dressel


1 Answers

There are two possible answer for this.

NSNotificationCenter is used to post notifications within the app itself. Say for instance you want several classes all to receive information that something has happened (or something) then you would use this. https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/nsnotificationcenter_Class/Reference/Reference.html

If you mean Remote Notifications i.e. push notifications that you receive from Apple then the AppDelegate receives these in a couple of its methods...

https://developer.apple.com/library/ios/documentation/uikit/reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40006786-CH3-SW16

Edit: It's not possible between apps. See comments.

like image 57
Fogmeister Avatar answered Oct 20 '22 09:10

Fogmeister