沙箱我的应用程序与脚本桥发送电子邮件 [英] Sandboxing my App with Scripting Bridge to send email

查看:177
本文介绍了沙箱我的应用程序与脚本桥发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用脚本桥从我的Mac应用程序发送电子邮件。

I'm using a scripting bridge for sending mails from my Mac App. Now I need to sandbox the app and sending mails is not longer working while sandboxing is enabled.

有人知道如何解决这个问题吗?

Does anybody know how to fix that?

感谢,
Andreas

Thanks, Andreas

代码:
`

/* create a Scripting Bridge object for talking to the Mail application */
    MailApplication *mail = [SBApplication applicationWithBundleIdentifier:@"com.apple.Mail"];


/* create a new outgoing message object */
MailOutgoingMessage *emailMessage =
[[[mail classForScriptingClass:@"outgoing message"] alloc]
 initWithProperties:
 [NSDictionary dictionaryWithObjectsAndKeys:
  [self.subjectField stringValue], @"subject",
  [[self.messageContent textStorage] string], @"content",
  nil]];

/* add the object to the mail app  */
[[mail outgoingMessages] addObject: emailMessage];
...

`

推荐答案

您不能使用启用沙盒的ScriptingBridge。请提交错误报告。这是苹果推荐的,如果沙盒是一个问题,你没有其他解决方案。他们可能为ScriptingBridge添加授权(不仅仅是临时例外),但是现在没有其他信息可用。

You can't use the ScriptingBridge with Sandboxing enabled. Please file a bug report. This is what Apple recommends, if Sandboxing is a problem for you and there are no other solutions. They might add entitlements (not just temporary exceptions) for the ScriptingBridge, but as of now there is no further information available.

a href =http://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/ApplicationSandboxingEntitlementKeys/ApplicationSandboxingEntitlementKeys.html#//apple_ref/doc/uid/TP40005929-CH7-SW1 = nofollow>授权键,特别是 com.apple.security.temporary-exceptions.apple-events 键,可以添加到您的Entitlements.plist文件,但是Apple Events的关键是暂时的异常。

不幸的是,即使设置了正确的权利,我也无法使ScriptingBridge正常工作。

There are Entitlements Keys, especially the com.apple.security.temporary-exception.apple-events key, you can add to your Entitlements.plist file, but the key for Apple Events is a temporary exception.
Unfortunately, I was unable to get ScriptingBridge working even with the correct entitlements set. I hope you're luckier than me.

苹果将要求提交给Mac App Store的所有应用程序使用沙箱功能, em> 11月1日

Apple is going to require Sandboxing for all apps submitted to the Mac App Store starting on the 1st of November!

com.apple.security.temporary-exception.apple-events

这篇关于沙箱我的应用程序与脚本桥发送电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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