Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
180 views
in Technique[技术] by (71.8m points)

ios - 2.3: Apps that do not perform as advertised by the developer will be rejected

sorry for my english.

My app lets you record and share recordings with iTunes. I proceeded to move the database to another folder with this method in the AppDelegate.m

    - (NSURL *)applicationDocumentsDirectory
{
    NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject];
    NSString *path = [libraryPath stringByAppendingPathComponent:@"Private Documents"];
    NSURL *pathURL = [NSURL fileURLWithPath:path];
    BOOL isDirectory = NO;
    if ([[NSFileManager defaultManager] fileExistsAtPath:path isDirectory:&isDirectory]) {
        if (isDirectory) {
            return pathURL;
        } else {
            [NSException raise:@"'Private Documents' exists, and is a file" format:@"Path: %@", path];
        }
    }
    NSError *error = nil;
    if (![[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error]) {
        [NSException raise:@"Failed creating directory" format:@"[%@], %@", path, error];
    }
    return pathURL;
}

My app has the UIFileSharingEnabled key set to true in the Info.plist. Everything seems to work perfectly but this is the response I received:

We found that your app did not achieve the core functionality described in your marketing materials or release notes, as required by the App Store Review Guidelines.

Your app has the UIFileSharingEnabled key set to true in the Info.plist, but this feature is not functional.

When file sharing is enabled, the entire Documents folder is used for file sharing. Files that are not intended for user access via the file sharing feature should be stored in another part of your application's bundle. If your application does not require the file sharing feature, the UIFileSharingEnabled key in the Info.plist should not be set to true.

For discrete code-level questions, you may wish to consult with Apple Developer Technical Support. Please be sure to:

  • include the complete details of your rejection issues
  • prepare any symbolicated crash logs, screenshots, and 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.

If you have difficulty reproducing this issue, please try testing the workflow as described in https://developer.apple.com/library/ios/qa/qa1764/Technical Q&A QA1764: How to reproduce a crash or bug that only App Review or users are seeing.

How to fix this issue? Thanks for all.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The problem is that you mark the UIFileSharingEnable to True, but you didn't use it correctly.

They wrote you that you probably trying share files that the user not allowed to get access, that's probably your main problem.

anyway if you're just trying share records to iTunes, you can use this code and try modify it for your requests:

you should put it in your AppDelegte file.

NSString *fileName = @"your_file_name";
        NSFileManager *fileManager = [NSFileManager defaultManager];
        NSError *error;
        NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
        NSString *documentsDirectory = [paths objectAtIndex:0];
        NSString *documentDBFolderPath = [documentsDirectory stringByAppendingPathComponent:fileName];


    if (![fileManager fileExistsAtPath:documentDBFolderPath])
    {
        NSString *resourceDBFolderPath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:fileName];
        [fileManager copyItemAtPath:resourceDBFolderPath toPath:documentDBFolderPath error:&error];
    }

Hop i helped you Thanks.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...