mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2025-02-04 12:57:35 +01:00
63 lines
1.4 KiB
Swift
63 lines
1.4 KiB
Swift
//
|
|
// CloudKitPublicZone.swift
|
|
// Account
|
|
//
|
|
// Created by Maurice Parker on 4/4/20.
|
|
// Copyright © 2020 Ranchero Software, LLC. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import CloudKit
|
|
import os.log
|
|
|
|
final class CloudKitPublicZone: CloudKitZone {
|
|
|
|
static var zoneID: CKRecordZone.ID {
|
|
return CKRecordZone.default().zoneID
|
|
}
|
|
|
|
var log = OSLog(subsystem: Bundle.main.bundleIdentifier!, category: "CloudKit")
|
|
|
|
weak var container: CKContainer?
|
|
weak var database: CKDatabase?
|
|
var delegate: CloudKitZoneDelegate?
|
|
|
|
struct CloudKitWebFeed {
|
|
static let recordType = "WebFeed"
|
|
struct Fields {
|
|
static let url = "url"
|
|
static let httpLastModified = "httpLastModified"
|
|
static let httpEtag = "httpEtag"
|
|
}
|
|
}
|
|
|
|
struct CloudKitUserSubscription {
|
|
static let recordType = "UserSubscription"
|
|
struct Fields {
|
|
static let user = "user"
|
|
static let webFeed = "webFeed"
|
|
static let subscriptionID = "subscriptionID"
|
|
}
|
|
}
|
|
|
|
init(container: CKContainer) {
|
|
self.container = container
|
|
self.database = container.publicCloudDatabase
|
|
}
|
|
|
|
func subscribe() {}
|
|
|
|
func receiveRemoteNotification(userInfo: [AnyHashable : Any], completion: @escaping () -> Void) {
|
|
completion()
|
|
}
|
|
|
|
func createSubscription(_ webFeed: WebFeed, completion: @escaping (Result<Void, Error>) -> Void) {
|
|
completion(.success(()))
|
|
}
|
|
|
|
func removeSubscription(_ webFeed: WebFeed, completion: @escaping (Result<Void, Error>) -> Void) {
|
|
completion(.success(()))
|
|
}
|
|
|
|
}
|