ota_update 1.0.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 89

ota_update #

pub package

Flutter plugin implementing OTA update.
On Android it downloads the file (with progress reporting) and triggers app installation intent.
On iOS it opens safari with specified ipa url. (not yet functioning)

Usage #

To use this plugin, add ota_update as a dependency in your pubspec.yaml file.

Example #

// IMPORT PACKAGE
import 'package:ota_update/ota_update.dart';

// RUN OTA UPDATE 
try {
  // START LISTENING FOR DOWNLOAD PROGRESS REPORTING EVENTS
  try {
    //LINK CONTAINS APK OF FLUTTER HELLO WORLD FROM FLUTTER SDK EXAMPLES
    OtaUpdate().execute('https://test1.4q.sk/flutter_hello_world.apk').listen(
      (OtaEvent event) {
        print('EVENT: ${event.status} : ${event.value}');
      },
    );
  } catch (e) {
    print('Failed to make OTA update. Details: $e');
  }

Android #

Add following provider referrence to AndroidManifest.xml

<provider
    android:name="sk.fourq.otaupdate.OtaUpdateFileProvider"
    android:authorities="sk.fourq.ota_update.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
        android:name="android.support.FILE_PROVIDER_PATHS"
        android:resource="@xml/filepaths" />
</provider>

Statuses #

  • DOWNLOADING:
    • status for events during downloading phase
    • event value is download progress percentage
  • INSTALLING:
    • event status that is sent just before triggering installation intent
    • event value is null
  • ALREADY_RUNNING_ERROR:
    • sent when 'execute' method is called before previous run finished
    • event value is null
  • PERMISSION_NOT_GRANTED_ERROR:
    • sent when user refused to grant required permissions
    • event value is null.
  • INTERNAL_ERROR:
    • sent in all other error cases
    • event value is underlying error message

TODO #

  • restrict download to specific connection type (mobile, wifi)

Contribution and Support #

  • Contributions are welcome!
  • If you want to contribute code please create a PR
  • If you find a bug or want a feature, please fill an issue

1.0.2 #

  • ios syntax error fix (by tchunwei)

1.0.1 #

  • migration of embeded example to AndroidX
  • Upgraded Gradle to latest version

1.0.0 #

  • migration to AndroidX and boost compileVersion to 28 (by tchunwei)

0.1.3 #

  • extended Android FileProvider to prevent possible conflicts with other plugins that also use FileProvider.

0.1.2 #

  • fixing NullPointerException when onRequestPermissionsResult was triggered by different plugin than this one

0.1.1 #

  • refactor to use streams only as communication channel
  • documentation changes

0.1.0 #

  • Initial release

example/README.md

ota_update_example #

Demonstrates how to use the ota_update plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  ota_update: ^1.0.2

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:ota_update/ota_update.dart';
  
Version Uploaded Documentation Archive
1.0.2 Feb 25, 2019 Go to the documentation of ota_update 1.0.2 Download ota_update 1.0.2 archive
1.0.1 Feb 20, 2019 Go to the documentation of ota_update 1.0.1 Download ota_update 1.0.1 archive
1.0.0 Feb 19, 2019 Go to the documentation of ota_update 1.0.0 Download ota_update 1.0.0 archive
0.1.3 Jan 30, 2019 Go to the documentation of ota_update 0.1.3 Download ota_update 0.1.3 archive
0.1.2 Nov 5, 2018 Go to the documentation of ota_update 0.1.2 Download ota_update 0.1.2 archive
0.1.1 Oct 29, 2018 Go to the documentation of ota_update 0.1.1 Download ota_update 0.1.1 archive
0.1.0 Oct 29, 2018 Go to the documentation of ota_update 0.1.0 Download ota_update 0.1.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
78
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
89
Learn more about scoring.

We analyzed this package on Jun 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.1
  • pana: 0.12.17
  • Flutter: 1.5.4-hotfix.2

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health suggestions

Format lib/generated/i18n.dart.

Run flutter format to format lib/generated/i18n.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8