Presenting a local notification immediately

suggest change

If you want to show a local notification immediately, call presentLocalNotificationNow. notification must already be a UILocalNotification. This API was deprecated in iOS 10 in favor of UNUserNotificationCenter.

Swift 3

UIApplication.shared.presentLocalNotificationNow(notification)

Swift 2

UIApplication.sharedApplication().presentLocalNotificationNow(notification)

Objective-C

[[UIApplication sharedApplication] presentLocalNotificationNow:notification];

An advantage of using this is so you won’t have to set the fireDate and timeZone properties of your UILocalNotification object.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents