shorecat_code_push 0.1.0
shorecat_code_push: ^0.1.0 copied to clipboard
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()inmain(): opens the updater, clears the boot breadcrumb after the first frame, checks for a patch in the background.ShorecatFlutterActivity: extend it fromMainActivity(shorecat initdoes this). It adds--aot-shared-library-namefor the installed patch.ShorecatBoot.engineArgs(context): the same arguments for hosts that build their ownFlutterEngine(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.