패키지, 저장소 및 앱 카테고리 검색

패키지 상세v0.0.5

icloud_storage_sync

iCloud Sync Flutter 플러그인을 사용하여 앱 데이터를 쉽게 동기화하고 보호하며 원활한 iCloud 통합을 구현하세요.

iOSmacOS
30일 다운로드
784
좋아요
45
Pub 점수
150

패키지 설치

flutter pub add icloud_storage_sync

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

icloud_storage_sync 패키지는 iOS 및 macOS용 Flutter 앱에 원활한 iCloud 통합을 제공하여 개발자가 앱 데이터를 iCloud에서 쉽게 동기화하고 안전하게 저장할 수 있도록 합니다. 이는 사용자가 정보에 일관되게 접근할 수 있도록 장치 간 데이터 지속성을 관리하기 위한 간단한 API를 제공합니다. 보안을 우선 고려해 설계되었으며, Apple의 iCloud 서비스를 활용하여 민감한 데이터를 보호하면서도 성능과 신뢰성을 유지합니다. 최소한의 설정으로 크로스 디바이스 동기화가 필요한 앱에 적합합니다.

사용 사례

  • 다기기 데이터 동기화
  • 사용자 데이터를 위한 안전한 클라우드 백업
  • Flutter 앱에서의 원활한 iCloud 통합
  • 오프라인 우선 앱과 클라우드 동기화
  • 사용자 프로필 및 선호도 지속성

주요 기능

  • iOS 및 macOS에서의 네이티브 iCloud 통합
  • 장치 간 자동 데이터 동기화
  • 엔드 투 엔드 암호화 지원
  • 간편한 구현을 위한 간단한 플러터 API
  • 강력한 오류 처리 및 상태 모니터링

적합한 대상

  • iOS 및 macOS Flutter 개발자
  • 지속적인 사용자 데이터가 필요한 앱
  • 개인정보 보호 중심 애플리케이션
  • 네이티브 클라우드 솔루션을 찾는 개발자
  • 최소 구성이 필요한 프로젝트

고려 사항

  • Apple 개발자 계정 및 iCloud 기능이 필요합니다
  • iOS 및 macOS 플랫폼에 한정
  • 올바른 iCloud 권한 및 프로비저닝에 따라 다릅니다
  • 기업 사용을 위해 추가 설정이 필요할 수 있습니다
  • Android 또는 웹 플랫폼과 호환되지 않습니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

📦☁️ iCloud_Storage_Sync Plugin

Seamless iCloud integration for your Flutter iOS apps!

iCloud Storage Sync Banner

🌟 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
🔍 Filter by path prefix
⏱️ Timeout support

Advanced Features:

  • 🔍 Path Filtering - Query specific subdirectories instead of entire container for better performance
  • ⏱️ Timeout Support - Set time limits on metadata queries to prevent indefinite hangs
  • 📊 Progress Tracking - Monitor upload/download progress with callbacks
  • 🔄 Stream Updates - Receive live updates as files change in iCloud

🚀 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. 🔧 Configure Your iCloud Container ID

Update your iCloud Container ID in the example app:

In example/lib/controller/icloud_plugin_controller.dart:

final iCloudContainerId = 'iCloud.com.yourcompany.appname'; // Replace with your container ID

In example/ios/Runner/Info.plist:

<key>iCloud.com.yourcompany.appname</key>  <!-- Replace with your container ID -->

In example/ios/Runner/Runner.entitlements and RunnerDebug.entitlements:

<string>iCloud.com.yourcompany.appname</string>  <!-- Replace with your container ID -->

ℹ️ Note: Your iCloud Container ID should match the format: iCloud.<your-team-id>.<your-bundle-id>

4. 💻 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);
}
📂 Gathering Files with Path Filtering & Timeout
// Gather files with optional path prefix filtering
Future<List<ICloudFile>> gatherFilesFromSubdirectory({
  required String containerId,
  required String pathPrefix,
}) async {
  return await icloudSyncPlugin.gather(
    containerId: containerId,
    relativePathPrefix: pathPrefix, // e.g., 'Documents/', 'Projects/MyApp/'
  );
}

// Gather files with timeout to prevent indefinite hangs
Future<List<ICloudFile>> gatherFilesWithTimeout({
  required String containerId,
  required Duration timeout,
}) async {
  try {
    return await icloudSyncPlugin.gather(
      containerId: containerId,
      timeout: timeout, // e.g., Duration(seconds: 30)
    );
  } on PlatformException catch (e) {
    if (e.code == 'METADATA_QUERY_TIMEOUT') {
      debugPrint('iCloud query timed out');
    }
    return [];
  }
}

// Combine both features for optimal performance
Future<List<ICloudFile>> gatherFilesOptimized({
  required String containerId,
  required String pathPrefix,
}) async {
  return await icloudSyncPlugin.gather(
    containerId: containerId,
    relativePathPrefix: pathPrefix,
    timeout: Duration(seconds: 30),
  );
}

Features:

  • 📂 relativePathPrefix - Filter to specific subdirectory for faster queries
  • ⏱️ timeout - Set time limit to prevent indefinite hangs
  • 🔄 Both parameters are optional and backwards compatible
📤 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,
  required bool isDirectory
}) async {
  await icloudSyncPlugin.delete(
    containerId: containerId,
    relativePath: relativePath,
    isDirectory: isDirectory
  );
}
🔄 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

  1. 👤 Log in to your Apple Developer account and select 'Certificates, IDs & Profiles'.

  2. 🆔 Create an App ID (if needed) and an iCloud Containers ID:

    iCloud Container ID
  3. 🔗 Assign the iCloud Container to your App ID:

    Assign iCloud Capability
  4. 💻 In Xcode, enable iCloud capability and select your container:

    Xcode Capability

🤝 Contributing


🙏 Acknowledgements

  • Thanks to all the contributors who have helped shape this plugin
  • Apple for providing the iCloud infrastructure

Made with ❤️ by the DevCodeSpace

카테고리

의존성

의존성 목록 4 개

소스 저장소

이 패키지를 사용하는 프로젝트

아직 데이터가 없습니다.