我无法在我尝试在 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/