This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
managed_configurations is a Flutter plugin that reads managed app configuration from MDM (Mobile Device Management) providers. It supports Android, iOS, and macOS. The plugin provides both a one-shot getter and a stream for listening to configuration changes.
# Analyze Dart code
fvm flutter analyze
# Run the example app (from example/ directory)
cd example && fvm flutter run
# Dry-run publish check
fvm flutter pub publish --dry-runThere are no unit tests in this project.
This is a federated Flutter plugin using method channels and event channels for native communication.
managed_configurations.dart— Public API:ManagedConfigurationsclass andSeverityenum. Entry point for consumers.managed_configurations_platform_interface.dart— Abstract platform interface extendingPlatformInterface.managed_configurations_method_channel.dart— Default implementation usingMethodChannel(managed_configurations_method) andEventChannel(managed_configurations_event). Decodes JSON strings from native intoMap<String, dynamic>.
- Single file:
ManagedConfigurationsPlugin.kt - Uses
RestrictionsManagerto read app restrictions (runs I/O on background thread viaExecutors) - Listens for
ACTION_APPLICATION_RESTRICTIONS_CHANGEDbroadcasts and pushes updates through EventChannel - Supports
KeyedAppStatesReporterfor reporting state back to EMM (Android-only feature) - Uses Gson with a custom
BundleTypeAdapterFactoryfor serializingBundleto JSON
- Single file:
ManagedConfigurationsPlugin.swift— shared between iOS and macOS viasharedDarwinSource - Reads from
UserDefaultskeycom.apple.configuration.managed SwiftStreamHandlerobservesUserDefaults.didChangeNotificationfor live updates, deduplicating via last-known JSON string
| Channel | Type | Purpose |
|---|---|---|
managed_configurations_method |
MethodChannel | One-shot config reads + reportKeyedAppState |
managed_configurations_event |
EventChannel | Stream of config change notifications |
Uses lints (recommended ruleset) with camel_case_types and non_constant_identifier_names rules disabled (see analysis_options.yaml).
The stream getter is misspelled as mangedConfigurationsStream (missing 'a' in "managed") — this is part of the public API and must remain for backwards compatibility.