是否有任何特殊参数需要UILocalNotification才能在锁定屏幕上显示,如Facebook Messenger消息?我的通知确实出现在通知中心的“通知”下。我认为这种行为与AppStore通知类似,只是将通知显示为通知,但用户从未收到警报。UILocalNotification不显示在锁定屏幕上
1
A
回答
0
当您完成registerUserNotificationSettings
时,您可能没有添加.Badge
。你应该有
let settings = UIUserNotificationSettings(forTypes: [.Alert, .Badge, .Sound], categories: categories)
application.registerUserNotificationSettings(settings)
0
你必须获得在锁定屏幕上显示通知的权限!一旦看看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
}
相关问题
- 1. 在锁定屏幕上显示通知
- 2. 在锁定的Android屏幕上显示
- 3. 在锁定屏幕上显示警报?
- 4. 唤醒屏幕并在锁定屏幕上显示对话框
- 5. 定制SimpleCursorAdapter不显示在屏幕上
- 6. 在Android中锁定屏幕上显示自定义信息
- 7. UILocalNotification如何显示应用程序图标,当屏幕被锁定
- 8. 屏幕锁定时显示优惠券
- 9. 如何在锁定屏幕控件上显示搜索栏
- 10. 在锁定屏幕上显示弹出窗口
- 11. MPNowPlayingInfoCenter在锁定屏幕上显示歌词
- 12. Cordova在锁定屏幕上显示内容android
- 13. iPhone,如何在锁定屏幕上显示更改对话框?
- 14. 锁定屏幕
- 15. 锁定屏幕
- 16. 在屏幕上显示textView
- 17. 在屏幕上显示
- 18. 在屏幕滚动过多之后,在屏幕上锁定div?
- 19. 视频不显示在屏幕上
- 20. 的UIImage不会在屏幕上显示
- 21. ProgrssBar不显示在屏幕上
- 22. JLabel在屏幕上不显示图像
- 23. 上显示屏而不是上次打开的屏幕显示
- 24. Android SDL2在锁定屏幕上恢复
- 25. 锁定MFC屏幕
- 26. 屏幕锁定Contineously
- 27. 锁定屏幕在10.6
- 28. 锁定屏幕在Android中
- 29. 在双屏显示器上的C#应用程序,在屏幕锁定后恢复为单显示器
- 30. Java - 全屏幕JFrame不显示在打印屏幕/屏幕录制上?
这取决于用户的偏好。如果用户不想在锁定屏幕中看到您的通知,则不会显示。 – matt 2014-09-26 01:44:55
该应用程序已被设置为在锁定屏幕上显示,但我从未见过它显示在那里。但它确实显示本地通知已触发,并显示在通知中心。 – Pochi 2014-09-26 01:50:35
没有没有特殊的参数显示它在锁定的屏幕上...请参阅此链接.... http://stackoverflow.com/questions/25929665/features-supported-by-ios8-interactive-notification/25930069#25930069欲了解更多信息...请参阅此... https://github.com/sgup77/SGNotification – 2014-09-26 05:35:31