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

패키지 상세v1.1.0

asset_delivery

플레이 에셋 딜리버리와 함께 필요 시 자산 배달을 관리하기 위한 플러터 플러그인으로, 자산 팩 설정, 진행률 추적 및 지속 저장을 지원합니다.

AndroidiOS
30일 다운로드
415
좋아요
12
Pub 점수
140

패키지 설치

flutter pub add asset_delivery

패키지 개요

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

Google Play 자산 배달을 사용하여 필요 시 자산을 전달할 수 있는 플러터 플러그인으로, 개발자가 3D 모델, 오디오 및 비디오와 같은 대용량 자산을 효율적으로 관리할 수 있도록 합니다. 자산 팩 설정, 다운로드 중 실시간 진행률 추적, 앱 재시작 후에도 지속적인 저장을 지원합니다. 안드로이드 및 iOS를 위한 것으로, 플레이 스토어의 자산 배달 시스템과 원활하게 통합되어 초기 앱 크기를 줄이고 필요한 경우에만 자산을 제공함으로써 사용자 경험을 향상시킵니다.

사용 사례

  • 요청에 따라 대규모 게임 자산 제공
  • 고품질 미디어 파일 스트리밍
  • 초기 앱 다운로드 크기 줄이기
  • 전체 앱 업데이트 없이 콘텐츠 업데이트
  • 동적 앱 내 콘텐츠 관리

주요 기능

  • Play 자산 전달을 통한 요청 시 자산 배달
  • 실시간 다운로드 진행률 추적
  • 세션 간 지속적인 자산 저장
  • Android 및 iOS 플랫폼 지원
  • Google Play 자산 배달 시스템과의 통합

적합한 대상

  • 대규모 자산 관리가 필요한 게임 개발자
  • 동적 또는 자주 업데이트되는 콘텐츠를 가진 앱
  • 앱 크기와 성능을 최적화하는 개발자
  • Google Play를 앱 배포에 사용하는 팀
  • 효과적인 콘텐츠 전달 워크플로우가 필요한 프로젝트

고려 사항

  • Android 자산 배달을 위해 Google Play가 필요합니다
  • Android 및 iOS 플랫폼에만 제한됨
  • Android의 Google Play 서비스에 의존
  • Google Play 콘솔에서 추가 구성이 필요할 수 있습니다
  • Google Play 외부에서 배포되는 앱에는 적합하지 않습니다

원본 README

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

Asset Delivery Plugin for Flutter

Introduction

The Asset Delivery Plugin simplifies managing on-demand asset delivery in Flutter applications. It integrates with Play Asset Delivery (Android) and On-Demand Resources (iOS), enabling dynamic asset downloads and seamless user experiences.

Key Features
  • On-Demand Asset Delivery: Download and access assets dynamically at runtime.
  • Customizable Resource Management: Flexible naming patterns and ranges for asset files.
  • Progress Tracking: Real-time download progress updates.
  • Cross-Platform Support: Compatible with both Android and iOS.

Installation

Add the following line to your pubspec.yaml file:

dependencies:
  asset_delivery: 
    git:
      url: https://github.com/mohsen-motlagh/asset_delivery.git
      ref: main

flutter:
  generate: true      

Setup

Android
Minimum SDK Version: 24
  1. Add the Play Asset Delivery library to your Gradle file:

    implementation "com.google.android.play:asset-delivery:2.2.2"
    
  2. Run the setup command in the terminal:

    dart run asset_delivery:setup_asset_pack "YourAssetPackName"
    
  3. A folder named after your asset pack will be created, containing:

    • A build.gradle.kts file.
    • A manifest folder with an AndroidManifest.xml file.
  4. Add your assets in the following path:

    ProjectDirectory/Android/YourAssetFolder/src/main/assets/"PUT YOUR ASSETS IN THIS DIRECTORY"
    
  5. Once published to the Play Store, you can retrieve assets dynamically. To test before publishing, follow the Testing steps below.

  6. For multiple asset packs, repeat these steps for each asset pack.


Android Testing

This method of testing is only available for Android versions below 12. Alternatively, you can publish your app to the Google Play Store for internal testing.

  1. Download the BundleTool.

  2. Build your app bundle and use the following commands:

    • Generate the APKs:

      java -jar bundletool.jar build-apks --bundle=<your_app_project_dir>/build/app/outputs/bundle/release/app-release.aab --output=<your_temp_dir>/app.apks --local-testing
      
    • Install the APKs on your device:

      java -jar bundletool.jar install-apks --apks=<your_temp_dir>/app.apks
      
  3. To get the final APK size:

    java -jar bundletool.jar get-size total --apks=<your_temp_dir>/app.apks --dimensions=SDK
    

iOS
  1. Open Xcode and navigate to your Runner project.

  2. Add your assets to the Assets folder.

  3. Configure the asset pack:

    • Select the asset or folder.
    • In the right panel, find On-Demand Resource Tags under the settings icon.
    • Add your Asset Pack Name (this should match the name used for Android).
  4. Ensure all assets are tagged appropriately.


iOS Testing

You can test your iOS app by running it from Xcode on a real device or simulator, as well as using flutter run --release.

Usage

  1. Download Assets
    On Android devices, download and install assets dynamically using:

    await assetDelivery.fetch("$assetpackName");
    
    - If the assets already exist on the device, the download will be skipped automatically.
    - On iOS, this step is not necessary as assets are accessed directly.
    
    
  2. Track Download Progress During the download, track the status of the asset pack by calling:

    await assetDelivery.getAssetPackStatus();
    
3. Retrieve Asset Path

Get the local path to the downloaded assets using the following code:

  final path = await assetDelivery.getAssetPackPath(
    assetPackName: widget.assetPackName,
    count: widget.assetsCount,
    namingPattern: widget.namingPattern,
    fileExtension: widget.fileExtension,
  );
  Parameters:

  assetPackName: The name of the asset pack.
  count: The number of assets in the pack.
  namingPattern: The naming convention for the assets.
  fileExtension: The file extension of the assets (e.g., 'mp3').
  1. Check for keyword "COMPLETED" from the status to be sure the assets completely downloaded
Example

Example App

Suppor

Please support the plugin by give a thumbs up in pub.dev and github

Contributions

Contributions are welcome! Feel free to submit issues or pull requests on GitHub.

License

This plugin is licensed under the MIT License. See the LICENSE file for details.

카테고리

의존성

의존성 목록 1 개

  • plugin_platform_interface^2.0.2

소스 저장소

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

아직 데이터가 없습니다.