Commit 6d533a7d59659bc7caa189ff8f6d07996f04f29c
1 parent
0caac569
提交0.0.4
Showing
3 changed files
with
12 additions
and
6 deletions
CNLiveICloudPicker/Classes/CNICloudManager.h
| @@ -35,10 +35,11 @@ NS_ASSUME_NONNULL_BEGIN | @@ -35,10 +35,11 @@ NS_ASSUME_NONNULL_BEGIN | ||
| 35 | 35 | ||
| 36 | @param url 文件路径 | 36 | @param url 文件路径 |
| 37 | @param maxSize 保存的最大尺寸 为 nil 忽略 | 37 | @param maxSize 保存的最大尺寸 为 nil 忽略 |
| 38 | - @param conversationId 群聊为群 ID, 单聊为好友ID (即 会话ID) | 38 | + @param path 群聊为群 ID, 单聊为好友ID (即 会话ID)路径 |
| 39 | + ([CNTools getChatFilesPathByUserId:conversationId]) | ||
| 39 | @param callBackContent 保存h的路径 url,是否保存成功,保存失败的描述 | 40 | @param callBackContent 保存h的路径 url,是否保存成功,保存失败的描述 |
| 40 | */ | 41 | */ |
| 41 | -+ (void)saveWithDocumentURL:(NSURL *)url maxSize:(float)maxSize conversationId:(NSString *)conversationId callBackContent:(void(^)(CNICloudDocumentModel *model, BOOL success, NSString * msg,NSInteger code))callBackContent; | 42 | ++ (void)saveWithDocumentURL:(NSURL *)url maxSize:(float)maxSize path:(NSString *)path callBackContent:(void(^)(CNICloudDocumentModel *model, BOOL success, NSString * msg,NSInteger code))callBackContent; |
| 42 | 43 | ||
| 43 | /** | 44 | /** |
| 44 | 文件是否在 iCloudBox 存在 | 45 | 文件是否在 iCloudBox 存在 |
CNLiveICloudPicker/Classes/CNICloudManager.m
| @@ -84,11 +84,12 @@ | @@ -84,11 +84,12 @@ | ||
| 84 | 84 | ||
| 85 | @param url 文件路径 | 85 | @param url 文件路径 |
| 86 | @param maxSize 保存的最大尺寸 为 nil 忽略 | 86 | @param maxSize 保存的最大尺寸 为 nil 忽略 |
| 87 | - @param conversationId 群聊为群 ID, 单聊为好友ID (即 会话ID) | 87 | + @param path 群聊为群 ID, 单聊为好友ID (即 会话ID)路径 |
| 88 | + ([CNTools getChatFilesPathByUserId:conversationId]) | ||
| 88 | @param callBackContent 保存h的路径 url,是否保存成功,保存失败的描述 | 89 | @param callBackContent 保存h的路径 url,是否保存成功,保存失败的描述 |
| 89 | */ | 90 | */ |
| 90 | 91 | ||
| 91 | -+ (void)saveWithDocumentURL:(NSURL *)url maxSize:(float)maxSize conversationId:(NSString *)conversationId callBackContent:(void(^)(CNICloudDocumentModel *model, BOOL success, NSString * msg, NSInteger code))callBackContent { | 92 | ++ (void)saveWithDocumentURL:(NSURL *)url maxSize:(float)maxSize path:(NSString *)path callBackContent:(void(^)(CNICloudDocumentModel *model, BOOL success, NSString * msg, NSInteger code))callBackContent { |
| 92 | 93 | ||
| 93 | if (![CNICloudManager iCloudEnable]) { | 94 | if (![CNICloudManager iCloudEnable]) { |
| 94 | callBackContent(nil, false, @"请在设置->AppleID、iCloud->iCloud中打开访问权限",code101); | 95 | callBackContent(nil, false, @"请在设置->AppleID、iCloud->iCloud中打开访问权限",code101); |
| @@ -123,8 +124,7 @@ | @@ -123,8 +124,7 @@ | ||
| 123 | 124 | ||
| 124 | if (data) { | 125 | if (data) { |
| 125 | 126 | ||
| 126 | - | ||
| 127 | - NSString *dataPath = [[CNTools getChatFilesPathByUserId:conversationId] stringByAppendingPathComponent:fileName]; | 127 | + NSString *dataPath = [[NSString stringWithFormat:@"%@",path] stringByAppendingPathComponent:fileName]; |
| 128 | NSURL *writeUrl = [[NSURL alloc]initFileURLWithPath:dataPath]; | 128 | NSURL *writeUrl = [[NSURL alloc]initFileURLWithPath:dataPath]; |
| 129 | [CNICloudFileHelper createDirectoryAtPath:kICloudBoxPath]; | 129 | [CNICloudFileHelper createDirectoryAtPath:kICloudBoxPath]; |
| 130 | 130 |
Example/CNLiveICloudPicker.xcodeproj/project.pbxproj
| @@ -247,6 +247,9 @@ | @@ -247,6 +247,9 @@ | ||
| 247 | LastUpgradeCheck = 0720; | 247 | LastUpgradeCheck = 0720; |
| 248 | ORGANIZATIONNAME = jyyjkt; | 248 | ORGANIZATIONNAME = jyyjkt; |
| 249 | TargetAttributes = { | 249 | TargetAttributes = { |
| 250 | + 6003F589195388D20070C39A = { | ||
| 251 | + DevelopmentTeam = 94X49GG3ZW; | ||
| 252 | + }; | ||
| 250 | 6003F5AD195388D20070C39A = { | 253 | 6003F5AD195388D20070C39A = { |
| 251 | TestTargetID = 6003F589195388D20070C39A; | 254 | TestTargetID = 6003F589195388D20070C39A; |
| 252 | }; | 255 | }; |
| @@ -497,6 +500,7 @@ | @@ -497,6 +500,7 @@ | ||
| 497 | baseConfigurationReference = F694DA87FF836C34F6E0F397 /* Pods-CNLiveICloudPicker_Example.debug.xcconfig */; | 500 | baseConfigurationReference = F694DA87FF836C34F6E0F397 /* Pods-CNLiveICloudPicker_Example.debug.xcconfig */; |
| 498 | buildSettings = { | 501 | buildSettings = { |
| 499 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 502 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 503 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | ||
| 500 | GCC_PRECOMPILE_PREFIX_HEADER = YES; | 504 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 501 | GCC_PREFIX_HEADER = "CNLiveICloudPicker/CNLiveICloudPicker-Prefix.pch"; | 505 | GCC_PREFIX_HEADER = "CNLiveICloudPicker/CNLiveICloudPicker-Prefix.pch"; |
| 502 | INFOPLIST_FILE = "CNLiveICloudPicker/CNLiveICloudPicker-Info.plist"; | 506 | INFOPLIST_FILE = "CNLiveICloudPicker/CNLiveICloudPicker-Info.plist"; |
| @@ -512,6 +516,7 @@ | @@ -512,6 +516,7 @@ | ||
| 512 | baseConfigurationReference = 44EF11549099F9444C7E25B6 /* Pods-CNLiveICloudPicker_Example.release.xcconfig */; | 516 | baseConfigurationReference = 44EF11549099F9444C7E25B6 /* Pods-CNLiveICloudPicker_Example.release.xcconfig */; |
| 513 | buildSettings = { | 517 | buildSettings = { |
| 514 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; | 518 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
| 519 | + DEVELOPMENT_TEAM = 94X49GG3ZW; | ||
| 515 | GCC_PRECOMPILE_PREFIX_HEADER = YES; | 520 | GCC_PRECOMPILE_PREFIX_HEADER = YES; |
| 516 | GCC_PREFIX_HEADER = "CNLiveICloudPicker/CNLiveICloudPicker-Prefix.pch"; | 521 | GCC_PREFIX_HEADER = "CNLiveICloudPicker/CNLiveICloudPicker-Prefix.pch"; |
| 517 | INFOPLIST_FILE = "CNLiveICloudPicker/CNLiveICloudPicker-Info.plist"; | 522 | INFOPLIST_FILE = "CNLiveICloudPicker/CNLiveICloudPicker-Info.plist"; |