Size limit
Diagnostics
CloudKit
앱 클립도 CloudKit public database에 접근 가능하게 됨
대신 그 외 다른 기능(쓰기 기능, document 접근 및 key-value store 접근 등)은 다 막혀 있음 → 앱클립을 지웠을때 모든 데이터를 깔끔하게 지우기 위함
// Read your CloudKit public database from your App Clip
let container = CKContainer.default()
let publicDatabase = container.publicCloudDatabase
let record = try await publicDatabase.record(for:
CKRecord.ID(recordName: "A928D582-9BB6-E9C5-7881-E4EAF615E0CD"))
if let title = record["Title"] as? String,
let description = record["Description"] as? String {
print(“Fetched a food item from CloudKit: \\(title) \\(description)")
}
keychain migration
// Write authentication token to App Clip keychain
// 코드 자체는 앱과 앱클립이 동일하다.
let addSecretsQuery: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecValueData as String: "smoothie-secret".data(using: .utf8),
kSecAttrLabel as String: "foodsample-appclip"
]
SecItemAdd(addSecretsQuery as CFDictionary, nil)
// Read authentication token from app or App Clip
var readSecretsQuery: [String: Any] = [
kSecClass as String: kSecClassGenericPassword,
kSecReturnAttributes as String: true,
kSecAttrLabel as String: "foodsample-appclip",
kSecReturnData as String: true
]
var secretsCopy: AnyObject?
SecItemCopyMatching(readSecretsQuery as CFDictionary, &secretsCopy)
AppClip experience API