行走在黑暗中

2014年11月08号,心城v1.1.0通过了苹果的审核。如果阅读过前面心城1.1.0今天提交审核了的朋友们会发现,时间俨然过了2周多。期间发生了什么事情?正常的Waiting For Review进入InReview大概1周差不多,这次怎么两周多了?

被拒了一次。

来看下被拒的原因吧,希望后面的朋友别和我一样。

1.问题描述

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Reasons
2.23: Apps must follow the iOS Data Storage Guidelines or they will be rejected
3.3: Apps with names, descriptions, screenshots, or previews not relevant to the content and functionality of the App will be rejected
----- 2.23 -----

We found that your app does not follow the iOS Data Storage Guidelines, which is required per the App Store Review Guidelines.

In particular, we found that on launch and/or content download, your app stores 2.04MB. To check how much data your app is storing:

- Install and launch your app
- Go to Settings > iCloud > Storage & Backup > Manage Storage
- If necessary, tap "Show all apps"
- Check your app's storage

The iOS Data Storage Guidelines indicate that only content that the user creates using your app, e.g., documents, new files, edits, etc., should be backed up by iCloud.

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.

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 NSURL objects, add the NSURLIsExcludedFromBackupKey attribute to prevent the corresponding file from being backed up. For CFURLRef objects, use the corresponding kCFURLIsExcludedFromBackupKey attribute.

For more information, please see Technical Q&A 1719: How do I prevent files from being backed up to iCloud and iTunes?.

It is necessary to revise your app to meet the requirements of the iOS Data Storage Guidelines.

----- 3.3 -----

In addition, your marketing screenshots do not sufficiently reflect the app in use, which does not give the user an accurate understanding of what the app does, as required by the App Store Review Guidelines.

We’ve attached the relevant screenshot(s) for your reference.

It would be appropriate to revise your screenshots to demonstrate the app functionality in use.

If your iTunes Connect Application State is Rejected, a new binary will be required. Make the desired metadata changes when you upload the new binary.

For discrete code-level questions, you may wish to consult with Apple Developer Technical Support. When the DTS engineer follows up with you, please be ready to provide:

- complete details of your rejection issue(s)
- screenshots
- steps to reproduce the issue(s)
- symbolicated crash logs - if your issue results in a crash log

一共两个原因。
分别对应苹果审核规则的2.23和3.3规则。

2.先说3.3 元数据问题

截图不够丰富,表达不了应用的功能,增加了3张图片解决问题。

3.再谈2.23 数据存储问题

心城将用户拍照以及头像设置的图片以及用户的录音文件都保存在了沙箱Documents文件夹,MagicalRecord用的数据库文件默认存放在了Library/Application Support目录下。

我举个例子来说明:

Documents下的文件是会被 iCloud 自动备份的,苹果的测试人员发现,他们拍了一些照片,录制一些音频,然后退出应用,同步iCloud发现数据有2.04M,很明显,照片和音频数据以及数据库文件(存放在Library下的ApplicationSupport下,同样会被iCloud自动同步)是造成这2.04M的罪魁祸首,所以被拒。

究其原因是我存储文件的位置不对或者说是规则不对造成的。为了避免被 iCloud 同步,需要对这些文件进行“不备份标记”。将文件夹标记为不备份,那么其子文件和子文件夹都不会被备份。这里还不敢对 Documents 标记不备份,那样“太过分了”,毕竟还有其他数据和文稿需要备份。对Documents下的不需要的文件夹进行标记即可。

和一个朋友交流中,他提到了他以前犯过的一个错误,他的应用在访问网络时,把一些图片存放在了 Documents 文件夹里面了,也是导致被拒,这些图片应该视情况放在tmp或者cache里面。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//沙盒Documents目录路径
#define DOC_PATH ([NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0])
//沙盒Cache目录路径
#define CACHE_PATH ([NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0])
//沙盒Library目录路径
#define LIB_PATH ([NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) objectAtIndex:0])
//沙盒Temp目录路径
#define TEMP_PATH (NSTemporaryDirectory())
// app data directory name
#define APP_DATA_PHOTOS_DIR_NAME @"photos"
#define APP_DATA_AUDIOS_DIR_NAME @"audios"
#define APP_DATA_AVATARS_DIR_NAME @"avatars"

-(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//.....
[self addSkipBackup];
//.....
}

-(void)addSkipBackup
{
NSString* photoDirPath = [DOC_PATH stringByAppendingPathComponent:APP_DATA_PHOTOS_DIR_NAME];
NSString* audioDirPath = [DOC_PATH stringByAppendingPathComponent:APP_DATA_AUDIOS_DIR_NAME];
NSString* avatarDirPath = [DOC_PATH stringByAppendingPathComponent:APP_DATA_AVATARS_DIR_NAME];

[self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:photoDirPath]];
[self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:audioDirPath]];
[self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:avatarDirPath]];
[self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:[NSPersistentStore MR_applicationStorageDirectory]]];
}

-(BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
assert([[NSFileManager defaultManager] fileExistsAtPath: [URL path]]);

NSError *error = nil;
BOOL success = [URL setResourceValue: [NSNumber numberWithBool: YES]
forKey: NSURLIsExcludedFromBackupKey error: &error];
if(!success){
NSLog(@"Error excluding %@ from backup %@", [URL lastPathComponent], error);
}
return success;
}

修改之后,重新提交,漫长的WaitingForReview又重新开始。今天进入了InReview后顺利通过上架。

4.杂说

在等待的期间,v1.2.0也在另外的分支开发着。今天1.1.0上架后,v1.2.0 也做了提交。

v1.2.0的改动
1.崭新的UI界面;
2.增加密码锁保护隐私;
3.消除了5连拍时存在的闪退隐患。

襁褓中的心城,并不完美也并不强大,虽然收到了负面的反馈,但不妨碍我把TA坚持做下去做好的决心。

行走在黑暗中,也许某天,会看到光明。

坚持原创技术分享,您的支持将鼓励我继续创作!