【问题标题】:App rejected due to temporary entitlement I need for NSSavePanel由于我需要 NSSavePanel 的临时权利,应用程序被拒绝
【发布时间】:2013-07-11 17:05:37
【问题描述】:

这是我的 Mac 应用第二次被 MAS 拒绝。 我使用临时授权,以便用户可以将他的备份文件存储在他的设备上创建的应用程序中。 这是我从 MAS 收到的拒绝回复:

We've determined that one or more temporary entitlement exceptions requested for 
this app are not appropriate and will not be granted:

com.apple.security.temporary-exception.files.home-relative-path.read-write  / 

非常模糊,第二次他们没有告诉我我正在做的事情有什么问题。

为此,我使用以下权利:

<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<string>True</string>
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
<array>
    <string>/</string>
</array>

这就是我使用权利的方式:

NSSavePanel* saveSelection = [NSSavePanel savePanel];

[saveSelection setPrompt:@"Export"];
[saveSelection setMessage:NSLocalizedString(@"Save your encrypted backup file to:",@"")];
[saveSelection setNameFieldStringValue:date];

[saveSelection beginSheetModalForWindow:kDelegate.window completionHandler:^(NSInteger result) {
if (result==NSFileHandlingPanelOKButton)
    {....
    }
}

我真的希望有人能提供帮助,并提前非常感谢!

【问题讨论】:

  • 您能否更具体地说明您如何使用该权利?也就是说,为什么使用沙盒兼容的保存对话框不起作用?
  • 我更新了答案以显示我如何使用权利。

标签: xcode macos appstore-approval appstore-sandbox entitlements


【解决方案1】:

我终于通过将它添加到 NSSavePanel 来让它工作:

[saveSelection setAllowedFileTypes:[NSArray arrayWithObject:@"whatever"]];
[saveSelection setAllowsOtherFileTypes:NO];

我不知道为什么这让它工作,但它确实......至少在我的应用程序中。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-03
    • 1970-01-01
    • 2018-01-09
    • 2017-09-06
    相关资源
    最近更新 更多