JNI and jnigen: Access Android In-App Update from Flutter

less than 1 minute read

I’ve just published new package using JNI bindings for Play Core In-App Update API. It lets you trigger flexible or immediate updates straight from Dart code without the usual method channel boilerplate.

Repository

package: play_in_app_update.

It is a thin layer over Play Core native libs generated with jnigen, so you call the same API you would in Kotlin, just from Dart. Works on Android 5.0+ (SDK 21) and supports both update types. See jnigen.dart for details how it’s been generated.

Example app includes a simple UI to trigger updates and shows how to listen to update state changes. You can check the README for testing and usage instructions.

Besides low-level access to the API that lets you use Android’s docs as if they were written for Dart, there’s also a more Flutter-friendly high-level API that uses Dart idioms (see wrapper.dart and corresponding example code).

If you end up shipping it in production and notice any rough edges, feel free to create issue.

Updated: