Skip to main content

shorecat_code_push 0.1.0 copy "shorecat_code_push: ^0.1.0" to clipboard
shorecat_code_push: ^0.1.0 copied to clipboard

PlatformAndroid

Over-the-air Dart code updates for Flutter Android apps, on the stock Flutter engine.

shorecat_code_push #

Flutter plugin that runs shorecat patches on Android, on the stock engine.

  • Shorecat.initialize() in main(): opens the updater, clears the boot breadcrumb after the first frame, checks for a patch in the background.
  • ShorecatFlutterActivity: extend it from MainActivity (shorecat init does this). It adds --aot-shared-library-name for the installed patch.
  • ShorecatBoot.engineArgs(context): the same arguments for hosts that build their own FlutterEngine (add-to-app, cached engines).
  • Shorecat.instance: currentPatchNumber, nextPatchNumber, isRestartRequired, update(), checkForUpdate(), restart().

Install #

flutter pub add shorecat_code_push
dart pub global activate shorecat_cli
shorecat init --server https://updates.example.com --token <admin-token>
import 'package:flutter/widgets.dart';
import 'package:shorecat_code_push/shorecat_code_push.dart';

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Shorecat.initialize();
  runApp(const MyApp());
}

Back up the private key generated by init on your developer machine. The server only needs the public key. See the hosting guide to install the server.

Code push only runs in Android release builds; initialize returns null elsewhere. The plugin declares the INTERNET permission, which release builds lack by default.

The example app is the demo used for the on-device test. Its shorecat.yaml points at a local test server; run shorecat init --force --server <url> --token <token> in example/ to point it at yours.

See the repository README and docs/architecture.md.

0
likes
160
points
445
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Over-the-air Dart code updates for Flutter Android apps, on the stock Flutter engine.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, shorecat_updater, yaml

More

Packages that depend on shorecat_code_push

Packages that implement shorecat_code_push