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

查看:136
本文介绍了由于未遵循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.

在早期版本中,我们还尝试将数据存储在私人目录中。但是,我们无法获得申请批准。

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.

其他人看到你的拒绝:


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.

事实上,肯定会通过审查的是切换到核心数据和使用内部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!
Oded

GL! Oded

- 编辑 -

另一个好帖子:
https://stackoverflow.com/questions/8164868/ios-data-storage-guidelines-可用 - 从什么时候开始

- 编辑#2 -

-- Edit #2 --

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

猜猜我应该只是指出重复...:)

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

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

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