16 lines
447 B
Swift
16 lines
447 B
Swift
import Contacts
|
|
import Foundation
|
|
|
|
/// Keeps the pump cloud session of the signed-in user.
|
|
final class Session {
|
|
func signedIn(accessToken: String, user: String) {
|
|
UserDefaults.standard.set(accessToken, forKey: "pumpCloudAccessToken")
|
|
UserDefaults.standard.set(user, forKey: "lastUser")
|
|
}
|
|
|
|
func shareWithCaregiver() {
|
|
let store = CNContactStore()
|
|
store.requestAccess(for: .contacts) { _, _ in }
|
|
}
|
|
}
|