应用程序因未遵循 iOS 数据存储指南而被拒绝 [英] Application rejected because of not following iOS Data Storage Guidelines

查看:26
本文介绍了应用程序因未遵循 iOS 数据存储指南而被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在将数据存储到应用程序的 Document 目录中,但我们拒绝了应用程序.我们已经尝试使用不备份"属性在当前版本中使用以下代码存储数据.

We're storing data into Document directory of application and we got rejection of application. We've tried with "do not back up" attribute for storing data in current version with below code.

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL{

    const char* filePath = [[URL path] fileSystemRepresentation];

    const char* attrName = "com.apple.MobileBackup";

    u_int8_t attrValue = 1;

    int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);

    return result == 0;

}

我们已根据 iOS 数据存储指南使用它.

We've used it as per iOS Data Storage Guidelines.

在早期版本中,我们还尝试将数据存储在 Private 目录中.但是,我们未能获得申请批准.

In earlier version we've also tried with storing data in Private directory. But, we were not able to get approval of application.

您能否详细说明为什么我们无法获得申请批准?或者,我们需要对有关数据存储的代码进行任何其他更改吗?所以,我们可以得到批准,我们在 iTunes 上有了新版本的应用程序.

Can you please give us some more description regarding why we are not able to get approval of application? or yet, we need any other changes in code regarding data storage? So, that we can get approval and we've new version of application on iTunes.

推荐答案

我认为@Jasarien 的评论是正确的答案,但没有进一步的交流,而且这个问题相对较新,所以我会扩展.

I think @Jasarien's comment is the right answer, but there was no further comm, and this question is relatively new, so I'll expand.

为了让其他人看到你的拒绝:

For others to see the rejection you get:

iOS 数据存储指南规定:

The iOS Data Storage Guidelines specify:

  1. 只有用户生成的或应用程序无法以其他方式重新创建的文档和其他数据才应存储在/Documents 目录中,并由 iCloud 自动备份.

  1. Only documents and other data that is user-generated, or that cannot otherwise be recreated by your application, should be stored in the /Documents directory and will be automatically backed up by iCloud.

可以再次下载或重新生成的数据应存储在/Library/Caches 目录中.您应该放在 Caches 目录中的文件示例包括数据库缓存文件和可下载内容,例如杂志、报纸和地图应用程序使用的内容.

Data that can be downloaded again or regenerated should be stored in the /Library/Caches directory. Examples of files you should put in the Caches directory include database cache files and downloadable content, such as that used by magazine, newspaper, and map applications.

仅临时使用的数据应存储在/tmp 目录中.尽管这些文件没有备份到 iCloud,但请记住在使用完这些文件后将其删除,以免它们继续占用用户设备上的空间.

Data that is used only temporarily should be stored in the /tmp directory. Although these files are not backed up to iCloud, remember to delete those files when you are done with them so that they do not continue to consume space on the user’s device.

使用不备份"属性来指定应该保留在设备上的文件,即使是在低存储空间的情况下.将此属性用于可以重新创建但即使在低存储情况下也需要保留的数据,以便您的应用程序正常运行,或者因为客户希望它在离线使用期间可用.此属性适用于标记的文件,无论它们在哪个目录中,包括 Documents 目录.这些文件不会被清除,也不会包含在用户的 iCloud 或 iTunes 备份中.由于这些文件确实会使用设备上的存储空间,因此您的应用负责定期监控和清除这些文件."

Use the "do not back up" attribute for specifying files that should remain on device, even in low storage situations. Use this attribute with data that can be recreated but needs to persist even in low storage situations for proper functioning of your app or because customers expect it to be available during offline use. This attribute works on marked files regardless of what directory they are in, including the Documents directory. These files will not be purged and will not be included in the user's iCloud or iTunes backup. Because these files do use on-device storage space, your app is responsible for monitoring and purging these files periodically."

例如,只有用户使用您的应用创建的内容,例如文档、新文件、编辑等,才能存储在/Documents 目录中 - 并由 iCloud 进行备份.

For example, only content that the user creates using your app, e.g., documents, new files, edits, etc., may be stored in the /Documents directory - and backed up by iCloud.

应用使用的临时文件只能存放在/tmp目录下;请记住在用户退出应用程序时删除存储在此位置的文件.

Temporary files used by your app should only be stored in the /tmp directory; please remember to delete the files stored in this location when the user exits the app.

可以重新创建但必须保留以保证您的应用正常运行的数据(或者因为客户希望它可用于离线使用)应标记为不备份"属性.有关更多信息,请参阅技术问答 1719:如何防止文件被备份到 iCloud 和 iTunes?.

Data that can be recreated but must persist for proper functioning of your app - or because customers expect it to be available for offline use - should be marked with the "do not back up" attribute. For more information, please see Technical Q&A 1719: How do I prevent files from being backed up to iCloud and iTunes?.

所以我明白为什么你会使用不备份"并期望遵守,但我认为就像@Jasarien 所说的 - 它们意味着你可以移动到更离散的目录,如缓存或临时.

So I see why you would use "do not back up" and expect to be in compliance, but I think like @Jasarien said - They mean for you to move to more discrete directories like cache or temp.

事实上,肯定会通过审核的是切换到 Core Data 并使用内部 SQLite - 但这可能工作量太大.

In fact what would definitely pass the review is switching to Core Data and using the internal SQLite - but that's probably too much work.

所以总结一下 - 关于如何保存到缓存或 tmp 的帖子 -在 iOS 5 应用程序中保存文件的位置?(实际上,也许这完全是那个的重复... :-/)

So to wrap up - a post on how to save to caches or tmp - Where to save files in iOS 5 applications? (actually, maybe this was all a duplicate of that one... :-/)

GL!奥德

-- 编辑 --

另一个好帖子:https://stackoverflow.com/questions/8164868/ios-data-storage-指南可用时间

-- 编辑 #2 --

-- Edit #2 --

另一个好帖子:iOS 5 不允许将下载的数据存储在 Documents 目录中?

我想我应该指出重复项... :)

Guess I should've just pointed out the duplicates... :)

这篇关于应用程序因未遵循 iOS 数据存储指南而被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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