为什么我的应用从AppStore的拒绝虽然我不是使用iCloud [英] why my app is rejected from appstore although i am not using icloud

查看:252
本文介绍了为什么我的应用从AppStore的拒绝虽然我不是使用iCloud的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有使用任何的iCloud存储

2.23的原因:应用程序必须遵循的iOS数据存储的准则,否则将被拒绝
----- ----- 2.23我们发现您的应用程序不遵循iOS的数据存储的准则,这是每个在App Store审查指南要求。特别是,我们发现,发射和/或下载内容,您的应用程序商店21.12 MB。要检查您的应用程序有多少数据存储: - 安装并启动APP-进入设置> iCloud的>存储和放大器;备份>管理存储 - 如果有必要,请点击显示所有的应用程序 - 检查你的应用程序的storageThe iOS的数据存储指引表明,用户创建的使用你的应用程序只有内容,例如,文件,新文件,编辑,等,应通过的iCloud进行备份。通过您的应用程序使用的临时文件只能存储在/ tmp目录;请记住,当用户退出应用删除存储在此位置的文件。或者是因为客户希望它是可以脱机使用 - - 可以重现,但必须坚持你的应用程序的正常运行数据应标有不备份属性。对于NSURL对象,在 NSURLIsExcludedFromBackupKey 属性被备份添加到prevent相应的文件。对于CFURLRef对象,使用相应的 kCFURLIsExcludedFromBackupKey 属性。欲了解更多信息,请参见技术Q&安培; A 1719:我如何$被备份到iCloud和iTunes p $ pvent文件?

要离线存储数据到SQLite的我的功能

  +(的NSString *)saveImageInDocuments:(*的UIImage)senderImage {
    NSArray的*路径= NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);
    的NSString * documentsDirectory = [路径objectAtIndex:0];    * NSDate的选择=的NSDate日期];    NSDateFormatter * DATEFORMAT = [[NSDateFormatter的alloc]初始化];
    [日期格式setDateFormat:@ddmmyyyyhhmmss];
    * NSString的imgName = [DATEFORMAT stringFromDate:选择];    imgName = [的NSString stringWithFormat:@%@ JPG,imgName]    * NSString的savedImagePath = [documentsDirectory stringByAppendingPathComponent:imgName];    * UIImage的图像= senderImage;
    NSData的*为imageData = [NSData的dataWithData:UIImagePNGRe presentation(图)];
    [为imageData将writeToFile:savedImagePath原子:YES];
     的NSLog(@路径为...%@,savedImagePath);
    返回imgName;}

和从源码我使用这个功能离线获取数据

  +(*的UIImage)getImageFromDocuments:(* NSString的)senderImageName {    的NSString * documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,是)objectAtIndex:0];
    * NSString的getImagePath = [documentsDirectory stringByAppendingPathComponent:senderImageName];    *的NSFileManager文件管理= [的NSFileManager defaultManager]
    BOOL fileExist = [文件管理器fileExistsAtPath:getImagePath]; //返回一个BOOL    * UIImage的IMG = [UIImage的ALLOC] INIT]
    如果(fileExist)
    {
        IMG = [UIImage的ALLOC] INIT]
        IMG = [UIImage的imageWithContentsOfFile:getImagePath];
    }
    的NSLog(@路径为...%@,getImagePath);
    返回IMG;
}


解决方案

您必须设置一个标志,你不希​​望在iCloud上同步文件。默认情况下的iOS同步。在iCloud上的应用程序的数据,如果设备设置允许它。

使用这个方法来跳过从备份文件

   - (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)网址{    浮版本= [[[的UIDevice currentDevice] systemVersion]的floatValue]
    如果(版本> 5.0){
        为const char *文件路径= [[URL路径] fileSystemRe presentation]。        为const char * attrName =com.apple.MobileBackup;
        u_int8_t attrValue = 1;        INT结果= setxattr(文件路径,attrName,&放大器; attrValue,sizeof的(attrValue),0,0);
        返回结果== 0;
    }
    返回NO;
}
[个体经营addSkipBackupAttributeToItemAtURL:[[NSURL页头] initFileURLWithPath:YOURFILEPATH]];

I did not use any icloud storage

Reasons 2.23: Apps must follow the iOS Data Storage Guidelines or they 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 21.12 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., 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?.


To Store data offline into Sqlite my function is

+ (NSString*)saveImageInDocuments:(UIImage*)senderImage {
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];

    NSDate *selected = [NSDate date];

    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
    [dateFormat setDateFormat:@"ddmmyyyyhhmmss"];
    NSString *imgName = [dateFormat stringFromDate:selected];

    imgName = [NSString stringWithFormat:@"%@.jpg",imgName];

    NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:imgName];

    UIImage *image = senderImage;
    NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(image)];
    [imageData writeToFile:savedImagePath atomically:YES];
     NSLog(@"path is... %@",savedImagePath);
    return imgName;



}

And to get data offline from sqlite i am using this function

+ (UIImage*)getImageFromDocuments:(NSString*)senderImageName {

    NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
    NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:senderImageName];

    NSFileManager *fileManager = [NSFileManager defaultManager];
    BOOL fileExist = [fileManager fileExistsAtPath:getImagePath]; // Returns a BOOL

    UIImage *img = [[UIImage alloc] init];
    if(fileExist)
    {
        img = [[UIImage alloc] init];
        img = [UIImage imageWithContentsOfFile:getImagePath];
    }
    NSLog(@"path is... %@",getImagePath);
    return img;
}

解决方案

You have to set a flags for files which you don't want to sync on iCloud. By default iOS Sync. app data on iCloud if device settings allow it.

Use this method to skip files from backup

- (BOOL)addSkipBackupAttributeToItemAtURL: (NSURL *)URL {

    float version = [[[UIDevice currentDevice] systemVersion] floatValue];
    if (version > 5.0) {
        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;
    }
    return NO;
}
[self addSkipBackupAttributeToItemAtURL:[[NSURL alloc] initFileURLWithPath:"YOURFILEPATH"]];

这篇关于为什么我的应用从AppStore的拒绝虽然我不是使用iCloud的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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