flutter_app_host 0.2.2

flutter_app_host #

Integrate app distribution and over-the-air (OTA) installation into your Flutter workflow. This package allows you to directly upload your Android .apk and iOS .ipa packages to the AppHost hosting service. Then, simply share your app's private link with testers and enterprise app users.

Example usage #

Upload your latest Android release build to hosting:

>> flutter packages pub run flutter_app_host apk-release

Result:

Upload complete! Install your app from:

https://appho.st/d/#/d3Yg88ve

Installation #

  1. Add flutter_app_host to dev_dependencies in your project's pubspec.yaml file
  2. Sign up for a free account at https://appho.st
  3. Enable the private upload API by going to the Dashboard page and generating an API key
  4. Add an App to your account (set the name, logo, etc.)
  5. On the page for your new app, scroll to the Private API section and download your config file
  6. Rename the config file to .apphost and move it to the root of your local project directory (probably add it to your .gitignore too...)

Usage #

>> flutter packages pub run flutter_app_host

Displays a list of detected build outputs and the relevant commands to upload them:

Found the following application builds:

* Android: release build, version 1.1.0
>> flutter packages pub run flutter_app_host apk-release

* Android: debug build, version 1.1.0
>> flutter packages pub run flutter_app_host apk-debug

Manually upload Android build archives (.apk file):
>> flutter packages pub run flutter_app_host apk <version> <filename>

Manually upload iOS build archives (.ipa file):
https://flutter.dev/docs/deployment/ios#create-a-build-archive
>> flutter packages pub run flutter_app_host ipa <version> <filename> <ios_bundle_identifier>

Configuration #

The package relies on a configuration file .apphost in the directory its called from. This is a JSON document with the following structure:

{
  "user_id": "...",
  "app_id": "...",
  "key": "my_private_api_key...",
  "ios_bundle_identifier": "com.mycompany.myapp..."
}

The last field, ios_bundle_identifier, is optional. It can be used to avoid having to specify the bundle identifier when uploading iOS .ipa archives.

[0.2.2] - April 23, 2019

  • Fix parsing of Android releases

[0.2.1] - April 23, 2019

  • Include a few examples

[0.2.0] - April 23, 2019

  • Allow manual file uploads (necessary for iOS app packages)

[0.1.1] - April 23, 2019

  • Code formatting tweaks

[0.1.0] - April 22, 2019

  • Initial release with Android package functionality.

example/README.md

Show available commands #

>> flutter packages pub run flutter_app_host

Output:

Found the following application builds:

* Android: release build, version 1.1.0
>> flutter packages pub run flutter_app_host apk-release

* Android: debug build, version 1.1.0
>> flutter packages pub run flutter_app_host apk-debug

Manually upload Android build archives (.apk file):
>> flutter packages pub run flutter_app_host apk <version> <filename>

Manually upload iOS build archives (.ipa file):
https://flutter.dev/docs/deployment/ios#create-a-build-archive
>> flutter packages pub run flutter_app_host ipa <version> <filename> <ios_bundle_identifier>

Upload your most recent Android release build #

>> flutter packages pub run flutter_app_host apk-release

Output:

Upload complete! Install your app from:

https://appho.st/d/#/d3Yg88ve

Manually upload an Android app package #

>> flutter packages pub run flutter_app_host apk 1.2.1 my_app_file.apk

Manually upload an iOS app package #

Flutter builds for iOS must be signed and archived from XCode before they can be distributed. See https://flutter.dev/docs/deployment/ios#create-a-build-archive for more information. Once you have your app package (.ipa file), use the following command to upload it. The last parameter, ios_bundle_identifier, should match the bundle identifier used by XCode to provision your app.

>> flutter packages pub run flutter_app_host ipa 1.2.1 runner.ipa com.mycompany.appname

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_app_host: ^0.2.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or 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:flutter_app_host/flutter_app_host.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
14
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
56
Learn more about scoring.

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

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, other

Primary library: package:flutter_app_host/flutter_app_host.dart with components: io.

Health issues and suggestions

Document public APIs. (-1 points)

8 out of 8 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/flutter_app_host.dart. (-1.99 points)

Analysis of lib/flutter_app_host.dart reported 4 hints:

line 54 col 17: Avoid empty catch blocks.

line 60 col 17: Avoid empty catch blocks.

line 76 col 43: DO use curly braces for all flow control structures.

line 131 col 7: DO use curly braces for all flow control structures.

Fix bin/flutter_app_host.dart. (-0.50 points)

Analysis of bin/flutter_app_host.dart reported 1 hint:

line 1 col 60: Use lowercase_with_underscores when specifying a library prefix.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
http ^0.12.0+2 0.12.0+2
path ^1.6.2 1.6.4
Transitive dependencies
async 2.3.0
charcode 1.1.2
collection 1.14.12
http_parser 3.1.3
meta 1.1.7
pedantic 1.8.0+1
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6