पैकेज, रिपॉज़िटरी और ऐप श्रेणियाँ खोजें

पैकेज विवरणv1.0.0

flutter_autoupdate

अपने Flutter एप्लिकेशन में स्वचालित अपडेट कार्यक्षमता आसानी से जोड़ें

AndroidiOSmacOS
30-दिन डाउनलोड
203
लाइक
44
Pub अंक
120

पैकेज इंस्टॉल करें

flutter pub add flutter_autoupdate

पैकेज अवलोकन

सार्वजनिक जानकारी से बना चयन मार्गदर्शन। केवल संदर्भ हेतु।

flutter_autoupdate एक Flutter पैकेज है जो मोबाइल और डेस्कटॉप एप्लिकेशन में स्वचालित अपडेट कार्यक्षमता के एकीकरण को सरल बनाता है। यह ऐप्स को अपडेट की जाँच, पृष्ठभूमि में डाउनलोड करने और उपयोगकर्ताओं को नए संस्करण के लिए इंस्टॉल करने के लिए आसानी से प्रेरित करने में सक्षम बनाता है। यह Android, iOS और macOS के लिए डिज़ाइन किया गया है, और दोनों ऐप स्टोर और सीधे वितरण मॉडल का समर्थन करता है। पैकेज संस्करण की तुलना, अपडेट उपलब्धता का पता लगाने और कस्टमाइज़ किए जा सकने वाले अपडेट डायलॉग प्रदान करता है। विकासकर्ता न्यूनतम कोड के साथ विश्वसनीय अपडेट वर्कफ्लो को आसानी से लागू कर सकते हैं। यह अक्सर फीचर रिलीज़ या सुरक्षा पैच की आवश्यकता वाले ऐप्स के लिए आदर्श है।

उपयोग

  • उत्पादन एप्लिकेशन में स्वचालित ऐप अपडेट
  • संस्करण अपग्रेड के दौरान बिना रुकावट उपयोगकर्ता अनुभव
  • कार्यप्रवाह को बाधित किए बिना पृष्ठभूमि अद्यतन जाँचें
  • iOS और macOS सहित कई प्लेटफॉर्म के लिए समर्थन
  • न्यूनतम आवश्यक ऐप संस्करण को लागू करना
  • हाथ से अपडेट प्रॉम्प्ट को कम करना

मुख्य विशेषताएँ

  • तात्कालिक अपडेट जाँच
  • कस्टमाइज़ करने योग्य अपडेट डायलॉग
  • बैकग्राउंड डाउनलोड समर्थन
  • प्लेटफॉर्म के अनुकूलता
  • संस्करण तुलना तर्क
  • एप्प स्टोर और सीधे डाउनलोड के साथ एकीकरण

इनके लिए उपयुक्त

  • क्रॉस-प्लेटफॉर्म Flutter ऐप्स बनाने वाले डेवलपर्स
  • स्वचालित रिलीज प्रबंधन की आवश्यकता वाली टीमें
  • अक्सर अपडेट की आवश्यकता वाले ऐप्स
  • कठोर संस्करण नियंत्रण नीति वाले प्रोजेक्ट
  • विश्वभर के उपयोगकर्ताओं को लक्षित करने वाले मोबाइल और डेस्कटॉप एप्लिकेशन

विचार योग्य बातें

  • प्रत्येक प्लेटफॉर्म के लिए सही कॉन्फ़िगरेशन की आवश्यकता होती है
  • कंपनी या साइडलोड किए गए ऐप्स के लिए अतिरिक्त हैंडलिंग की आवश्यकता हो सकती है
  • अपडेट व्यवहार ऐप स्टोर नीतियों पर निर्भर करता है
  • नेटवर्क की अनुमति देना आवश्यक है
  • स्वचालित डाउनलोड के लिए उपयोगकर्ता सहमति की आवश्यकता हो सकती है
  • सख्त ऑफलाइन आवश्यकताओं वाले एप्लिकेशन के लिए उपयुक्त नहीं

मूल 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 आइटम

सोर्स रिपॉज़िटरी

इस पैकेज का उपयोग करने वाले प्रोजेक्ट

अभी कोई डेटा उपलब्ध नहीं है।