Notification center - a notification does not appear in the notification center when they were received in the active application

I need all the notifications to appear in the notification center, and in my application only the notification received from the background or when the application is closed is presented in the notification center. That's my problem? How to add a notification to the notification center from the code?

Thank!

+5
source share
2 answers

Check if the application is active when you receive a notification

if ([[UIApplication sharedApplication] applicationState] == UIApplicationStateActive)

, . , , , .

+1

postNotification:, postNotificationName:object: postNotificationName:object:userInfo:

. NSNotificationCenter

, !

0

All Articles