π¦βοΈ iCloud_Storage_Sync Plugin
Seamless iCloud integration for your Flutter iOS apps!
π Introduction
iCloud_Storage_Sync simplifies iCloud storage integration, bringing powerful cloud capabilities to your Flutter iOS apps:
π Effortless backup and sync of app data
π±π» Consistent user experience across all devices
π Secure storage and retrieval of important information
βοΈ Seamless integration with the iCloud ecosystem
β¨ Features
Feature | Description |
---|---|
π | Get iCloud files |
β¬οΈ | Upload files to iCloud |
βοΈ | Rename iCloud files |
ποΈ | Delete iCloud files |
βοΈ | Move iCloud files |
π Getting Started
1. π οΈ Installation
Add this to your pubspec.yaml
:
dependencies:
icloud_storage_sync: ^1.0.0
2. βοΈ Install the Plugin
Run:
flutter pub get
3. π» Usage
Import in your Dart code:
import 'package:icloud_storage_sync/icloud_storage_sync.dart';
π Prerequisites
Before diving in, make sure you have:
βοΈ An Apple Developer account
βοΈ App ID and iCloud Container ID
βοΈ iCloud capability enabled and assigned
βοΈ iCloud capability configured in Xcode
π See How to set up iCloud Container for step-by-step instructions.
π§° API Examples
π₯ Getting iCloud Files
Future<List<CloudFiles>> getCloudFiles({required String containerId}) async {
return await icloudSyncPlugin.getCloudFiles(containerId: containerId);
}
π€ Uploading Files to iCloud
Future<void> upload({
required String containerId,
required String filePath,
String? destinationRelativePath,
StreamHandler<double>? onProgress,
}) async {
await icloudSyncPlugin.upload(
containerId: containerId,
filePath: filePath,
destinationRelativePath: destinationRelativePath,
onProgress: onProgress,
);
}
π·οΈ Renaming iCloud Files
Future<void> rename({
required String containerId,
required String relativePath,
required String newName,
}) async {
await icloudSyncPlugin.rename(
containerId: containerId,
relativePath: relativePath,
newName: newName,
);
}
ποΈ Deleting iCloud Files
Future<void> delete({
required String containerId,
required String relativePath,
}) async {
await icloudSyncPlugin.delete(
containerId: containerId,
relativePath: relativePath,
);
}
π Replace iCloud Files
Future replaceFile({
required String updatedFilePath,
required String relativePath
}) async {
await icloudSyncPlugin.replace(
containerId: iCloudContainerId,
updatedFilePath: updatedFilePath,
relativePath: relativePath,
);
}
π Moving iCloud Files
Future<void> move({
required String containerId,
required String fromRelativePath,
required String toRelativePath,
}) async {
await IcloudSyncPlatform.instance.move(
containerId: containerId,
fromRelativePath: fromRelativePath,
toRelativePath: toRelativePath,
);
}
π How to set up iCloud Container and enable the capability
-
π€ Log in to your Apple Developer account and select 'Certificates, IDs & Profiles'.
-
π Create an App ID (if needed) and an iCloud Containers ID:
-
π Assign the iCloud Container to your App ID:
-
π» In Xcode, enable iCloud capability and select your container:
π€ Contributing
π Acknowledgements
- Thanks to all the contributors who have helped shape this plugin
- Apple for providing the iCloud infrastructure
Made with β€οΈ by the DevCodeSpace