NSUserNotificationCenter:是否启用? [英] NSUserNotificationCenter: is it enabled?

查看:32
本文介绍了NSUserNotificationCenter:是否启用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 MacOS 10.8 上,如何确定是否启用了通知中心?我需要知道这一点才能选择如何通知用户.

On MacOS 10.8, how can it be determined if Notification Center is enabled or not? I need to know this to choose how to notify the user.

推荐答案

你可以读出存储在 ~/Lbrary/Application Support/NotificationCenter/中的通知中心的sqlite数据库,它存储了用户是否启用了通知中心的信息一个应用程序与否.此处提供示例代码.

You could read out Notification Center's sqlite database stored at ~/Lbrary/Application Support/NotificationCenter/, which stores the info whether the user has enabled the Notification Center for an app or not. Sample code available here.

这篇关于NSUserNotificationCenter:是否启用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆