diff --git a/Kiwix-iOS/Info.plist b/Kiwix-iOS/Info.plist index 2702917b..183da61a 100644 --- a/Kiwix-iOS/Info.plist +++ b/Kiwix-iOS/Info.plist @@ -49,7 +49,7 @@ CFBundleVersion - 1.8.1688 + 1.8.1706 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/Kiwix-iOSWidgets/Bookmarks/Info.plist b/Kiwix-iOSWidgets/Bookmarks/Info.plist index 93d8fdbd..ffa6f1c9 100644 --- a/Kiwix-iOSWidgets/Bookmarks/Info.plist +++ b/Kiwix-iOSWidgets/Bookmarks/Info.plist @@ -21,7 +21,7 @@ CFBundleSignature ???? CFBundleVersion - 1.8.1688 + 1.8.1707 NSExtension NSExtensionMainStoryboard diff --git a/Kiwix.xcodeproj/project.pbxproj b/Kiwix.xcodeproj/project.pbxproj index 142b4d0c..495876c9 100644 --- a/Kiwix.xcodeproj/project.pbxproj +++ b/Kiwix.xcodeproj/project.pbxproj @@ -693,6 +693,7 @@ 975334CD1CEB6A78007ED50B /* Others */, 931D277C156AE671D3F9EADA /* Frameworks */, F544A4E4357A6D33CF234C6B /* Pods */, + 9C1D0054BEA442431151A95D /* Products */, ); sourceTree = ""; }; @@ -796,6 +797,13 @@ path = "Kiwix-iOSWidgets"; sourceTree = ""; }; + 9C1D0054BEA442431151A95D /* Products */ = { + isa = PBXGroup; + children = ( + ); + name = Products; + sourceTree = ""; + }; CFDF64EC6F9DB861DEEB91A0 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -955,8 +963,11 @@ compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; + knownRegions = ( + en, + ); mainGroup = 97A2AB7F1C1B80FF00052E74; - productRefGroup = 97A2AB891C1B80FF00052E74 /* Products */; + productRefGroup = 9C1D0054BEA442431151A95D /* Products */; projectDirPath = ""; projectRoot = ""; targets = ( diff --git a/Kiwix/Operations/BookmarkOperation.swift b/Kiwix/Operations/BookmarkOperation.swift index 4409136d..b1ac082c 100644 --- a/Kiwix/Operations/BookmarkOperation.swift +++ b/Kiwix/Operations/BookmarkOperation.swift @@ -91,32 +91,53 @@ class BookmarkCloudKitOperation: Operation { } override func execute() { - guard let bookID = article.book?.id else {finish(); return} - - let recordID = CKRecordID(recordName: bookID + "|" + article.path) - let database = CKContainer(identifier: "iCloud.org.kiwix").privateCloudDatabase - - database.fetchRecordWithID(recordID) { (record, error) in - if let record = record { - if self.article.isBookmarked { - self.populate(record, with: self.article) - database.saveRecord(record, completionHandler: { (record, error) in - self.finish() - }) - } else { - database.deleteRecordWithID(recordID, completionHandler: { (recordID, error) in - self.finish() - }) - } - } else { - guard self.article.isBookmarked else {self.finish(); return} - let record = CKRecord(recordType: "Article", recordID: recordID) - self.populate(record, with: self.article) - database.saveRecord(record, completionHandler: { (record, error) in - self.finish() - }) - } +// guard let bookID = article.book?.id else {finish(); return} +// let container = CKContainer(identifier: "iCloud.org.kiwix") +// container.accountStatusWithCompletionHandler { (status, error) in +// guard status == .Available else {self.finish(); return} +// +// container.fetchUserRecordIDWithCompletionHandler({ (recordID, error) in +// guard let ownerName = recordID?.recordName else {self.finish(); return} +// let database = container.privateCloudDatabase +// let zoneID = CKRecordZoneID(zoneName: bookID, ownerName: ownerName) +// database.fetchRecordZoneWithID(zoneID, completionHandler: { (zone, error) in +// if let zone = zone { +// +// } else { +// database. +// } +// }) +// }) } + + + +// guard let bookID = article.book?.id else {finish(); return} +// +// let recordID = CKRecordID(recordName: bookID + "|" + article.path) +// let database = CKContainer(identifier: "iCloud.org.kiwix").privateCloudDatabase +// +// database.fetchRecordWithID(recordID) { (record, error) in +// if let record = record { +// if self.article.isBookmarked { +// self.populate(record, with: self.article) +// database.saveRecord(record, completionHandler: { (record, error) in +// self.finish() +// }) +// } else { +// database.deleteRecordWithID(recordID, completionHandler: { (recordID, error) in +// self.finish() +// }) +// } +// } else { +// guard self.article.isBookmarked else {self.finish(); return} +// let record = CKRecord(recordType: "Article", recordID: recordID) +// self.populate(record, with: self.article) +// database.saveRecord(record, completionHandler: { (record, error) in +// self.finish() +// }) +// } +// } } func populate(record: CKRecord, with article: Article) { diff --git a/Podfile b/Podfile index 6215c3b9..29d3499c 100644 --- a/Podfile +++ b/Podfile @@ -12,7 +12,7 @@ pod 'Operations', :git => 'https://github.com/ProcedureKit/ProcedureKit.git', :b end -target 'Kiwix-OSX' do +target 'Kiwix-macOS' do platform :osx, '10.10' diff --git a/Podfile.lock b/Podfile.lock index 56058a23..03b83851 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -28,6 +28,6 @@ SPEC CHECKSUMS: Operations: 6a33d325dae88de21b8edc69b9884fce01aea22b SwiftyUserDefaults: 7abdba50a50ea0c18ee8903af3c88e4c1cb8448d -PODFILE CHECKSUM: 7fce2ab788d4fea2728405e44965e38a852f02db +PODFILE CHECKSUM: e345ab565b0ce78937afe5c9543a0acc00375442 COCOAPODS: 1.0.1