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

패키지 상세v1.0.0

flutter_autoupdate

Flutter 애플리케이션에 자동 업데이트 기능을 쉽게 추가하세요

AndroidiOSmacOS
30일 다운로드
61
좋아요
44
Pub 점수
120

패키지 설치

flutter pub add flutter_autoupdate

패키지 개요

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

flutter_autoupdate는 모바일 및 데스크톱 애플리케이션에 자동 업데이트 기능을 통합하는 것을 간편하게 만드는 Flutter 패키지입니다. 앱은 업데이트를 확인하고 백그라운드에서 다운로드한 후 사용자에게 새 버전 설치를 원활하게 요청할 수 있습니다. Android, iOS, macOS용으로 설계되었으며 앱 스토어 배포 및 직접 배포 모델 모두를 지원합니다. 버전 비교, 업데이트 가능 여부 감지, 사용자 정의 가능한 업데이트 대화 상자를 제공합니다. 개발자는 최소한의 코드로 강력한 업데이트 워크플로우를 쉽게 구현할 수 있습니다. 자주 기능을 출시하거나 보안 패치가 필요한 앱에 적합합니다.

사용 사례

  • 생산 앱에서의 자동 앱 업데이트
  • 버전 업그레이드 중 시ーム리스 사용자 경험
  • 워크플로우를 방해하지 않고 백그라운드 업데이트 확인
  • iOS 및 macOS를 포함한 여러 플랫폼 지원
  • 최소 요구 앱 버전 강제 적용
  • 수동 업데이트 프롬프트 줄이기

주요 기능

  • 실시간 업데이트 확인
  • 사용자 정의 가능한 업데이트 대화 상자
  • 백그라운드 다운로드 지원
  • 크로스 플랫폼 호환성
  • 버전 비교 논리
  • 앱 스토어 및 직접 다운로드와의 통합

적합한 대상

  • 크로스 플랫폼 플러터 앱을 개발하는 개발자
  • 자동화된 릴리스 관리를 필요로 하는 팀
  • 자주 업데이트가 필요한 앱
  • 엄격한 버전 제어 정책을 가진 프로젝트
  • 글로벌 사용자를 대상으로 하는 모바일 및 데스크톱 애플리케이션

고려 사항

  • 각 플랫폼에 대해 올바른 구성이 필요합니다
  • 기업용 또는 사이드로드 앱에 대해 추가 처리가 필요할 수 있습니다
  • 업데이트 동작은 앱 스토어 정책에 따라 달라집니다
  • 네트워크 권한을 부여해야 합니다
  • 자동 다운로드를 위해 사용자 동의가 필요할 수 있습니다
  • 엄격한 오프라인 요구 사항을 가진 앱에는 적합하지 않습니다

원본 README

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

flutter_updater

This library allows you to easily add auto-update functionality to your Android, iOS, and Windows Flutter application.

Our use case was to update the app by launching the App Store on iOS or install/execute the Android APK or Windows executable; thus, this package was born. To use this package, you should adhere to the format of the Version Template below.

Features

  • Fetch updates from iTunes App Store/remote URL
  • Launch App Store
  • Download functionality with progress
  • SHA512 hash checksum on download

Installation

Run the following command

flutter pub add flutter_autoupdate

Import the package

import 'package:flutter_autoupdate/flutter_autoupdate.dart';

Add the following to your Android app.

  • AndroidManifest.xml
<!-- Provider -->
<provider
    android:name="androidx.core.content.FileProvider"
    android:authorities="${applicationId}.fileProvider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/file_paths" />
</provider>
  • android/app/src/main/res/xml/file_paths.xml
<?xml version="1.0" encoding="utf-8"?>
<paths>
    <external-path path="Android/data/<package name>/" name="files_root" />
    <external-path path="." name="external_storage_root" />
</paths>

Update the <package name> to your app package name

Examples

import 'package:flutter_updater/flutter_autoupdate.dart';

// Android/Windows
var updater = UpdateManager(versionUrl: 'versionUrl');

// iOS
var updater = UpdateManager(appId: 1500009417, countryCode: 'my');

// App Store country code, this flag is optional and only applies to iOS
var result = await updater.fetchUpdates();
print(result?.latestVersion);
print(result?.downloadUrl);
print(result?.releaseNotes);
print(result?.releaseDate);
 
if (result?.latestVersion > Version.parse('1.0.0')) {
  // Get update stream controller
  var update = await result?.initializeUpdate();
  update?.stream.listen((event) async {
    // You can build a download progressbar from the data available here
    print(event.receivedBytes);
    print(event.totalBytes);
    if (event.completed) {
      print('Download completed');

      // Close the stream controller
      await update.close();

      // On Windows, autoExit and exitDelay flag are supported.
      // On iOS, this will attempt to launch the App Store from the appId provided
      // On Android, this will simply attempt to install the downloaded APK
      await result?.runUpdate(event.path, autoExit: true, exitDelay: 5000);
    }
  });
}

For more information, check out the examples.

Version Template

By default, it will select the first index as the latest version. For more examples, sample.json is available for reference.

Android
[
  {
    "version": "3.0.0",
    "url": "https://storage.googleapis.com/download-dev.feedmepos.com/android/feedme-pos-3.0.0-beta.5.apk",
    "releaseNotes": "New update 3.0.0!",
    "releaseDate": "2021-07-28T11:58:25Z",
    "sha512": "2e0349c1e729eac0f4cb9f831fa1130241743c8db9e115013091dbeec6b8b86dc18c62bcbfab516033869c8ec8c8967615c622303d4bee62640c3b507051aca2"
  },
  {
    "version": "1.4.5",
    "url": "https://storage.googleapis.com/download-dev.feedmepos.com/android/feedme-pos-1.4.5.apk",
    "releaseNotes": "New update 1.4.5!",
    "releaseDate": "2021-06-16T11:58:25Z",
    "sha512": "f028475ad562f9f9566213774b02e0bd3ac2198899222687613937791307ec5d326cfb79ee2882273bffd6777f9c76371d6b2eed7d46e326fd687bc95e2edb2a"
  }
]
Windows
[
  {
    "version": "2.5.0",
    "url": "https://storage.googleapis.com/download-dev.feedmepos.com/feedme_sample.exe",
    "releaseNotes": "New update 2.5.0!",
    "releaseDate": "2021-07-28T11:58:25Z",
    "sha512": "53d4cc95ad07470b53b3f9bc010ab8c6776f2bc2f9f3115b0807ecebcc34175f530d02e549c260112ad08c2c86a8b92d7e7f11308df0406422be8ceea76a9190"
  }
]
iOS

It supports fetching updates by app id using the official iTunes Search API.

Contributing

We welcome the community to submit pull requests.

Bugs

  • Unable to install APK automatically after enabling "Install from unknown sources" from prompt

카테고리

의존성

의존성 목록 6 개

소스 저장소

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

아직 데이터가 없습니다.