iOS 应用因 2.23 被拒绝 - iOS 数据存储指南 [英] iOS App Rejection due to 2.23 - iOS Data Storage Guidelines

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

问题描述

以下是来自 Apple 的关于拒绝的消息:

Here's message from Apple about rejection :

2.23 - 应用程序必须遵循 iOS 数据存储指南,否则将被拒绝2.23 详情

2.23 - Apps must follow the iOS Data Storage Guidelines or they will be rejected 2.23 Details

在启动和内容下载时,您的应用程序存储 6.5 MB,这不会遵守 iOS 数据存储指南.

On launch and content download, your app stores 6.5 MB, which does not comply with the iOS Data Storage Guidelines.

后续步骤

请确认只有用户使用您的应用程序,例如文档、新文件、编辑等,由 iCloud 备份为iOS 数据存储指南要求.另外,检查是否有任何您的应用程序使用的临时文件仅存储在/tmp 中目录;请记住删除或删除存储在当确定不再需要它们时,此位置.

Please verify that only the content that the user creates using your app, e.g., documents, new files, edits, etc. is backed up by iCloud as required by the iOS Data Storage Guidelines. Also, check that any temporary files used by your app are only stored in the /tmp directory; please remember to remove or delete the files stored in this location when it is determined they are no longer needed.

可以重新创建但必须持久保存才能正常运行的数据您的应用 - 或者因为用户希望它可供离线使用- 应标有不备份"属性.对于 NSURL 对象,添加 NSURLIsExcludedFromBackupKey 属性以防止相应的文件被备份.对于 CFURLRef 对象,使用对应的 kCRUFLIsExcludedFromBackupKey 属性.

Data that can be recreated but must persist for proper functioning of your app - or because users expect it to be available for offline use - should be marked with the "do not back up" attribute. For NSURL objects, add the NSURLIsExcludedFromBackupKey attribute to prevent the corresponding file from being backed up. For CFURLRef objects, use the corresponding kCRUFLIsExcludedFromBackupKey attribute.

我检查了我的应用程序的数据文件,用于设备和模拟器.我发现如果应用程序使用了一段时间,在启动时它的总应用程序数据可以存储 5-6 MB.但是我卸载并重新安装了应用程序并再次检查,我在应用程序启动时看到了大约 3MB 的数据存储.

I checked out the data files of my application both for device and simulator. I found that if app has used for a while, it's total app data could store 5-6 MB, on launch. But I uninstalled and re-installed app and checked again, I see ~3MB data store on launch of app.

我不存储任何 Core Data 数据库或任何其他数据库文件.但我意识到 Google Analytics 和 Google Tag Manager 在此路径上存储了一些 sqlite 数据:AppData/Library".我的意思是它不存储在这条路径上:AppData/Library/Caches".它对 iOS 数据存储指南有什么影响吗?

I'm not storing any Core Data databases or any other database files. But I've realized that Google Analytics and Google Tag Manager stores some sqlite data on this path : "AppData/Library". I mean it does NOT store on this path : "AppData/Library/Caches". Does it make any difference for iOS Data Storage Guidelines?

顺便说一下,iCloud 已禁用应用程序.

By the way, iCloud is disabled for application.

此外,我使用 SDWebImage 下载图像,它在启动时存储了近 3 MB 的图像,并将图像数据存储在此路径上:AppData/Library/Caches"

Also I'm using SDWebImage for downloading images and it stores almost 3 MB images on the launch and it stores image data on this path : "AppData/Library/Caches"

你知道我应该怎么做来处理这个问题吗?

Do you have any idea that what should I do to handle this issue?

推荐答案

我昨天刚收到同样的拒绝消息.

I just got the same rejection message yesterday.

我在 application:didFinishLaunchingWithOptions: 中使用以下代码来查看我的应用程序在文档文件夹中的内容以及有关 iCloud 备份的每个项目的权限:

I use the following code in application:didFinishLaunchingWithOptions: to see what my application has inside the documents folder and what is the permission of each item about iCloud backup:

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil;
NSArray *documents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:basePath error:nil];
NSURL *URL;
NSString *completeFilePath;
for (NSString *file in documents) {
    completeFilePath = [NSString stringWithFormat:@"%@/%@", basePath, file];
    URL = [NSURL fileURLWithPath:completeFilePath];
    NSLog(@"File %@  is excluded from backup %@", file, [URL resourceValuesForKeys:[NSArray arrayWithObject:NSURLIsExcludedFromBackupKey] error:nil]);
}

我在那个文件夹中有一些与 iCloud 同步的文件.因此,我没有将这些文件保存在其他地方,而是将 NSURLIsExcludedFromBackupKey 键的资源值设置为 YES 以排除这些文件被 iCloud 备份,如下所示:

I had some files inside that folder that were synchronising with iCloud. So instead of saving those files in another place I set the resource value for the NSURLIsExcludedFromBackupKey key set to YES to exclude those files from being backed up by iCloud, like this:

NSURL *URL = [NSURL fileURLWithPath:photoPath];
[URL setResourceValue:@(YES) forKey:NSURLIsExcludedFromBackupKey error:nil];

我今天再次发送我的应用程序,看看是否有效.

I'm sending my app again today to see if works.

希望对您有所帮助.

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

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