cloud_kit
CloudKit는 추가 로그인 없이 여러 iOS 장치 간에 설정을 동기화할 수 있습니다.
iOS 앱에서 CloudKit를 사용하기 위한 Flutter 플러그인
{"sdk":"flutter"}{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
CloudKit is a simple Flutter package to access on iOS devices the iCloud using the Apple CloudKit Api. You can save with the package key value pairs in the private database of the users iCloud.
Simply create a new instance of the CloudKit class with the container id of the CloudKit container you created. And then, if the user is signed in to their iCloud account, you can store and delete key-value pairs.
First, instantiate a CloudKit instance to use the plugin. To do this, you will need to pass your container id, which you will need to create in order to use CloudKit. More information about creating a container can be found in the Setup section of this page.
CloudKit cloudKit = CloudKit('iCloud.dev.tutorialwork.cloudkitExample'); // Enter your container id
Before start using CloudKit you need to check if the user is logged in, otherwise the process of saving and getting value will fail.
CloudKitAccountStatus accountStatus = await cloudKit.getAccountStatus()
if (accountStatus == CloudKitAccountStatus.available) {
// User is logged in to iCloud, you can start using the plugin
}
Once the instance has been created, you can access it to retrieve, save and delete entries.
cloudKit.save('key', 'value'); // both must be strings, if you want to save objects use the JSON format
cloudKit.get('key'); // returns a string with the value or null if the key was not found or you are not on iOS
cloudKit.delete('key'); // returns a boolean if it was successful
You can also delete the entire user database with a single command.
cloudKit.clearDatabase(); // also returns a boolean if successful
And if you want to check what's in the database, you can also get all entries.
cloudKit.getAll(); // return a map with all key-value pairs -> {key: value, secondKey: secondValue}