From dc1353ea65a2ec73cd0efa82bd66a7f457669756 Mon Sep 17 00:00:00 2001 From: Danmei Chen Date: Thu, 24 Jan 2019 09:24:56 +0100 Subject: [PATCH] diable Icloud Drive if ios 11 is available --- Classes/ChatConversationView.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Classes/ChatConversationView.m b/Classes/ChatConversationView.m index 72b1b3bf7..9228e2537 100644 --- a/Classes/ChatConversationView.m +++ b/Classes/ChatConversationView.m @@ -1086,7 +1086,12 @@ void on_chat_room_conference_alert(LinphoneChatRoom *cr, const LinphoneEventLog - (BOOL)writeFileInICloud:(NSData *)data fileURL:(NSURL *)fileURL { NSFileManager *fileManager = [NSFileManager defaultManager]; - if (![[fileManager URLForUbiquityContainerIdentifier:nil]URLByAppendingPathComponent:@"Documents"]) { + BOOL useMyDevice = FALSE; + if (@available(iOS 11.0, *)) { + useMyDevice = TRUE; + } + + if (!useMyDevice && ![[fileManager URLForUbiquityContainerIdentifier:nil]URLByAppendingPathComponent:@"Documents"]) { //notify : set configuration to use icloud [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Info", nil) message:NSLocalizedString(@"ICloud Drive is unavailable.", nil) delegate:nil cancelButtonTitle:NSLocalizedString(@"Cancel", nil) otherButtonTitles:nil, nil] show]; return FALSE;