macos - 如何在 Lion 的沙盒应用程序中发送分布式通知?

标签 macos osx-lion sandbox appstore-sandbox

我无法在我尝试在 Lion 中沙箱化的应用程序中发送分布式通知。 得到…

deny distributed-notification-post

…在控制台的 system.log 中。是否可以添加任何权利以允许通知。

是否可以做到,如果可以,怎么做?

最佳答案

如果您不需要包含用户信息字典,它应该可以工作;如果没有,请在 Apple 的开发论坛上提问和/或提交雷达。

但如果您确实需要包含用户信息字典,则无法执行,也没有直接的解决方法。如果您查看 App Sandbox Design Guide,在“确定您的 App 是否适合沙盒”部分中说:

The following app behaviors are incompatible with App Sandbox:

...

  • Sending user-info dictionaries in broadcast notifications

    With App Sandbox, you can send notifications, but you cannot include a user-info dictionary in the notifications you send.

因此,您必须重写您的应用程序才能使用其他机制进行进程间通信。 (Growl 项目可能是一个有用的资源,因为他们在大多数其他人之前经历了这个,而且是公开的。)

关于macos - 如何在 Lion 的沙盒应用程序中发送分布式通知?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9482098/

相关文章:

hadoop - 启动后如何在沙箱上启动h2o

macos - 如何在 OSX 中从命令行导出单个私钥?

python - 通过 pyenv 安装的解释器不会添加到 $PATH

macos - Mac OS X 文件关联有效,但文件图标未更改

python - 键盘中断不会停止我的翻译

iphone - 攻击者能否破解 iOS 钥匙串(keychain)和数据保护加密?

macos - 在 mac os x 和 gettext 中从 git 安装 glib

readline - 在 OSX Lion 上使用 readline pip 安装 ipython

ruby - 错误: Rack app won't run -- bundler/setup

python - 防止 Python 代码导入某些模块?