Is there any special parameters an UILocalNotification has to have in order to show on the lock screen like the Facebook Messenger messages? My notification does appear on the notification center under "notifications". I think the behaviour is similar to the AppStore notifications in where they are only shown as a notification but the user is never alerted.
Asked
Active
Viewed 952 times
1
-
It's up to the user's preferences. If the user doesn't want to see your notification in the lock screen, it won't appear. – matt Sep 26 '14 at 01:44
-
The app has been set to show on the lock screen, but I have never seen it being displayed there. It does however show that a local notification was triggered, and it appears on the notification center. – Pochi Sep 26 '14 at 01:50
-
No there are no special parameters to show it on locked screen...Refer this link....http://stackoverflow.com/questions/25929665/features-supported-by-ios8-interactive-notification/25930069#25930069 for more info...refer this...https://github.com/sgup77/SGNotification – Sourav Gupta Sep 26 '14 at 05:35
-
Make sure you schedule the notification after a delay to have it appear on the lock screen after you lock the screen. – akc Jul 27 '15 at 05:38
2 Answers
0
You probably didn't add .Badge
when you did your registerUserNotificationSettings
. You should have
let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: categories)
application.registerUserNotificationSettings(settings)

Daniel
- 3,758
- 3
- 22
- 43
0
You have to take permission for show the notification on lock screen ! once look at the code in Appdelegate.m
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let notificationCategory = UIMutableUserNotificationCategory()
let categories = Set<UIUserNotificationCategory>(arrayLiteral: notificationCategory)
let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: categories)
application.registerUserNotificationSettings(settings)
return true
}

Pushp
- 1,064
- 10
- 18