gpt4 book ai didi

ios - 2.23前同样原因申请被拒

转载 作者:行者123 更新时间:2023-11-29 10:50:33 25 4
gpt4 key购买 nike

原因

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

我们发现您的应用不符合 App Store 审核指南所要求的 iOS 数据存储指南。

特别是,我们发现在启动和/或内容下载时,您的应用会存储 64 MB。要检查您的应用存储了多少数据:

  • 安装并启动您的应用
  • 转到“设置”>“iCloud”>“存储和备份”>“管理存储”
  • 如有必要,点按“显示所有应用”
  • 检查您应用的存储空间

iOS 数据存储指南指出,只有用户使用您的应用程序创建的内容(例如文档、新文件、编辑等)才应由 iCloud 备份。

您的应用程序使用的临时文件应仅存储在/tmp 目录中;请记得在用户退出应用程序时删除存储在该位置的文件。

可以重新创建但必须保留以使您的应用程序正常运行的数据 - 或者因为客户希望它可以离线使用 - 应该标记为“不备份”属性。对于 NSURL 对象,添加 NSURLIsExcludedFromBackupKey 属性,防止对应文件被备份。对于 CFURLRef 对象,使用相应的 kCFURLIsExcludedFromBackupKey 属性。

更多信息请参见技术问答1719:如何防止文件备份到iCloud和iTunes?

有必要修改您的应用程序以满足 iOS 数据存储指南的要求。对于离散的代码级问题,您可能希望咨询 Apple Developer Technical Support。请务必:

  • 包括您拒绝问题的完整细节
  • 准备任何符号化的崩溃日志、屏幕截图和步骤,以在 DTS 工程师跟进时重现问题。

有关如何符号化和读取崩溃日志的信息,请参阅技术说明 TN2151 了解和分析 iPhone 操作系统应用程序崩溃报告。

如果您难以重现此问题,请尝试按照 https://developer.apple.com/library/ios/qa/qa1764/ 中所述测试工作流程技术问答 QA1764:如何重现只有 App Review 或用户才能看到的崩溃或错误。我在 AppDelegate.m 中设置了这个函数

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSString *pathCaches = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Caches"];
NSString *pathTmp = [NSHomeDirectory() stringByAppendingPathComponent:@"/tmp"];
NSString *pathDocuments = [NSHomeDirectory() stringByAppendingPathComponent:@"/Documents"];

[self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:pathCaches]];
[self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:pathTmp]];
[self addSkipBackupAttributeToItemAtURL:[NSURL fileURLWithPath:pathDocuments]];
return YES;
}

- (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)URL
{
assert([[NSFileManager defaultManager] URLsForDirectory:NSCachesDirectory inDomains:NSUserDomainMask]);

const char* filePath = [[URL path] fileSystemRepresentation];

const char* attrName = "com.mycompany.MyApp";
u_int8_t attrValue = 1;

int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
return result == 0;
}

.sqlite3 文件没有下载所以我把它放在/Documents 和其他 pdf 文件和图像下载我的申请以同样的理由被拒绝我是不是忘记了什么???请帮助我

谢谢

最佳答案

如果您想为 iOS 5.0.1 及更高版本提交,请使用以下代码。我认为您不需要从 iCloud 备份中跳过缓存和 tmp 目录,因为 iCloud 不关心这些目录。

+(BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)fileURL {

// First ensure the file actually exists
if (![[NSFileManager defaultManager] fileExistsAtPath:[fileURL path]]) {
NSLog(@"File %@ doesn't exist!",[fileURL path]);
return NO;
}

// Determine the iOS version to choose correct skipBackup method
NSString *currSysVer = [[UIDevice currentDevice] systemVersion];

if ([currSysVer isEqualToString:@"5.0.1"]) {
const char* filePath = [[fileURL path] fileSystemRepresentation];
const char* attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
int result = setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
NSLog(@"Excluded '%@' from backup",fileURL);
return result == 0;
}
else if (&NSURLIsExcludedFromBackupKey) {
NSError *error = nil;
BOOL result = [fileURL setResourceValue:[NSNumber numberWithBool:YES] forKey:NSURLIsExcludedFromBackupKey error:&error];
if (result == NO) {
NSLog(@"Error excluding '%@' from backup. Error: %@",fileURL, error);
return NO;
}
else { // Succeeded
NSLog(@"Excluded '%@' from backup",fileURL);
return YES;
}
} else {
// iOS version is below 5.0, no need to do anything
return YES;
}
}

如果数据可以从服务器下载,那么不要将下载的文件保存到 Documents 目录,而是将它们保存到 Cache 目录,这是一个临时目录,不会备份到 iCloud 并且可以被随机删除特定场合下的操作系统。

关于ios - 2.23前同样原因申请被拒,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20652084/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com