App Storeの審査経過報告[iCloud対応]

New iPad出ましたね。

さて、今回は、当社に取ってタイムリーな話題、App Storeの審査についてです。


Hello XXX,

Your app XXXX has been reviewed, but we are unable to post this version. For details, or to directly contact the App Review team, visit the Resolution Center in iTunes Connect. Do not reply to this email.


App Review


Resolution Centerに来い、と言うので、iTunes Connectにログインします。
Manage Your Applicationsに進むと、アプリの一覧が出ます。対象のアプリをクリックすると、[Review Status]とあり、以下の文言が。

The most recent version of your app has been rejected. Before resubmitting it, visit the Resolution Center for details on outstanding issues.

で、横に[Resolution Center]と言うボタンがあるので、クリックします。

Binary Rejected Mar 22, 2012 06:12 PM
Reasons for Rejection:
2.23 Apps must follow the iOS Data Storage Guidelines or they will be rejected
Mar 22, 2012 06:12 PM. From Apple.

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.84 MB. 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., may be stored in the /Documents directory - and 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.
For discrete code-level questions, you may wish to consult with Apple Developer Technical Support. Please be sure to prepare any symbolicated crash logs, screenshots, or steps to reproduce the issues for when the DTS engineer follows up. For information on how to symbolicate and read a crash log, please see Tech Note TN2151 Understanding and Analyzing iPhone OS Application Crash Reports.

内部で保持しているデータが無駄にiCloudにバックアップされないような処置を施しなさい、と言うことの様です。iOS Storage Data Guidelinesを読めとあるので、表示してみると4つのパターンが示されています。

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.


2. 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.


3. 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.


4. 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. Learn more

For more information read the iOS App Programming Guide.

4."ローストレージシチュエーション"(ディスクパンパン状態)でも、デバイスに残しておくべきファイルには、「do not back up」属性を設定せよ。そうすれば、バックアップの対象外になるよ、です。

Learn moreの所に、リンク Technical Q&A QA1719 が張ってありまして、[do not back up]属性の設定方法が書かれています。

#include <sys/xattr.h>
- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
    const char* filePath = [[URL path] fileSystemRepresentation];
    const char* attrName = "";
    u_int8_t attrValue = 1;
    int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
    return result == 0;

setxattrをコールして、拡張属性を設定せよ、言うことらしいです。4については、iOS 5.0.1から加わった様ですね。