booleanmaths_flutter_sdk 0.2.1
booleanmaths_flutter_sdk: ^0.2.1 copied to clipboard
Flutter plugin for the BooleanMaths SDK — user event tracking and attribution.
0.2.1 #
-
Upgraded the Android SDK to
com.booleanmaths:bm-sdk:1.0.13.Fixes events silently vanishing from release builds. Up to 1.0.12 the AAR shipped an empty
proguard.txt, so it contributed no consumer keep rules. A host app building release withisMinifyEnabled = truelet R8 obfuscateBMEvent's field names — and Gson uses those field names verbatim as the JSON keys. Events were still queued, still uploaded, and the server still answered200; the payload just arrived with keys like{"a":…,"b":…}and nothing appeared in reporting. Debug builds were unaffected, which made it look like a release-only networking problem.1.0.13 ships real consumer rules (
-keep class com.booleanmaths.sdk.** { *; }plus-keepattributes Signature), and consumer rules apply automatically — so host apps need noproguard-rules.prochanges of their own. If you added keep rules forcom.booleanmaths.sdkas a workaround, they are now redundant but harmless.No API change; nothing in your code needs updating.
-
Also fixed a second, independent release-build failure that
bm-sdk1.0.13 does not address. The plugin now ships its own consumer ProGuard rules (android/consumer-rules.pro), applied to the host app automatically.WorkManager instantiates
InputMergerimplementations reflectively through their no-argument constructor.androidx.work's own consumer rules keep the classes but not their constructors, and R8 full mode — the default since AGP 8 — removes an unreferenced constructor even from a kept class:E WM-InputMerger: NoSuchMethodException: androidx.work.OverwritingInputMerger.<init> [] E WM-WorkerWrapper: Could not create Input Merger androidx.work.OverwritingInputMergerWorkerWrappermarks the work failed, soEventWorkernever runs. Events were persisted and never dispatched — and because SDK logging is gated onisDebug, a release build reported nothing at all. Verified on a minified release build: before the rule, dispatch never happened; after it,Worker result SUCCESSand the queued backlog went out.Note the two release-build bugs had different symptoms. The 1.0.12 Gson one uploaded events successfully with unreadable keys; this one never uploaded at all. Both looked like "release builds don't send events".
Known issue (upstream) #
bm-sdk1.0.13 reportssetup.sdk_versionas"1.0.12"— itsSDK_VERSIONconstant was not bumped with the release. Events from 1.0.13 are therefore indistinguishable from 1.0.12 ones in reporting. Cosmetic on the device, but it makes the broken-release-build population hard to identify server side. Nothing in this plugin can override it.
0.2.0 #
iOS is now implemented, and Android attribution actually works. Two breaking changes, both in the same area — see Breaking below.
iOS support #
- Implemented the iOS side against
BooleanMathsSDK ~> 1.2(CocoaPods Trunk).initialize,trackEvent,flushandgetHelloMessageall reach the native SDK; the previous release registered the channel and answeredFlutterMethodNotImplementedfor everything. - Minimum iOS version is 15.0. The
~> 1.2constraint is a floor as much as a ceiling:BooleanMathsSDK1.0.0 is still published carrying an iOS 17.0 deployment target and 1.1.0 requires 15.1, so allowing anything older would silently raise the floor for host apps. 1.2.0's public API is identical to 1.1.0's, so nothing is given up by requiring it. - iOS requires CocoaPods.
BooleanMathsSDKis distributed as a CocoaPods-only vendored XCFramework with no Swift package, so this plugin ships a podspec and noPackage.swift. Apps with Swift Package Manager enabled still build — Flutter falls back to CocoaPods per plugin — but they cannot drop CocoaPods entirely. YourPodfilemust declareplatform :ios, '15.0'or higher.
Breaking #
handleNotificationIntent(Map data)is nowhandleIntent(), with no arguments. The old version built a syntheticIntentout of a Dart map, which could never work: an intent with no action and no data cannot produce aDeepLinkClick, and it carried none of the campaign data from the intent that actually launched the app.handleIntenthands the SDK the real Activity intent instead.handleNotificationIntent()remains as a zero-argument deprecated alias and will be removed in 0.3.0.- Removed
getPlatformVersion(). UsegetHelloMessage(), which is a strictly better smoke test: it answers from the native BooleanMaths SDK, so a non-null result proves the native artifact linked, not merely that the plugin registered.
Attribution (Android) #
- The plugin is now
ActivityAwareand registers aNewIntentListener, so deep links and notification taps are attributed automatically — including on cold start, where the launch intent was previously invisible to the SDK. The SDK registers its own lifecycle callbacks insideinitialize(), which in a Flutter app runs long afterMainActivitywas created, soinitializealso forwards the current intent explicitly. - Host apps need no
MainActivityoverride. Flutter'sFlutterActivity.onNewIntentalready callssetIntentbefore dispatching to plugins.
Fixed #
- Upgraded the Android SDK from
com.booleanmaths:bm-sdk:1.0.8to1.0.12. 1.0.9 fixed a spuriousNotificationClickemitted on an ordinary launcher tap — on 1.0.8 every plain app open reported{"event":"NotificationClick","data":{"notification":{"action":"android.intent.action.MAIN"}}}, so dashboards built on events from earlier releases have been counting noise. - Event properties are normalized natively before reaching the SDK:
- Non-finite doubles (
NaN,±infinity) are dropped. On iOS these failJSONSerialization.isValidJSONObject, which bothEventDispatcherandEventStoreguard on — a singleNaNproperty silently discarded the event, and potentially the whole batch it shipped in. - Whole-valued doubles that convert exactly are sent as integers, so a
quantityof2.0is reported as2rather than2.0. - Null values and non-string keys are dropped, but nulls inside a list are preserved — removing one would shift the index of every element after it.
- Non-finite doubles (
wrapper_versionis no longer a hardcoded string in the Android plugin. It is generated frompubspec.yamlintolib/src/version.dartand passed across the channel, andtest/version_test.dartfails if the two drift. The 0.1.3 release shipped reporting0.1.2for exactly this reason.
Added #
isDebugoninitialize, defaulting tofalse— matching the native Android and iOS SDKs, so an app that says nothing reports production. Previously the plugin called the 3-argument native overload, so there was no way to reportdevelopmentat all. The default is intentionally not tied tokDebugMode: a staging release build and a debug build running against production credentials both exist, and neither is described by the build mode. PassisDebug: kDebugModeif you want that behaviour, where it stays visible at the call site.BooleanMaths.flush({timeout})— forces a dispatch attempt before a known interruption, such as a checkout hand-off. iOS only: it returnsfalseimmediately on Android, wherebm-sdkhas no flush and WorkManager owns the timing.falsemeans "no flush was performed", never that an event was lost.BooleanMaths.getHelloMessage()— bridge smoke test, straight from the native SDK.BooleanMaths.isSupported— true on Android and iOS only, so shared code can gate cleanly instead of relying on the silent no-op.
0.1.3 #
- Lowered the Dart SDK floor from
^3.13.0to>=3.3.0 <4.0.0. The old floor was scaffolding written byflutter create— it recorded the SDK on the machine that generated the package, not anything the code needs. Because every release since0.0.1carried it, apps on Dart 3.12 or earlier failed atpub getwith no older version to fall back to. Nothing here needs above Dart 3.0. - Corrected the Flutter floor to
>=3.19.0. It previously claimed>=3.3.0, which ships Dart 2.18 and cannot compile this package's class modifiers. - Fixed
setup.wrapper_versionin the event payload, which still reported0.1.2. It is hardcoded in the Android plugin and had drifted from the package version. - Example app: replaced two dot-shorthands (
.stretch,.bold) with their explicit enum names. The shorthand form requires Dart 3.10, which would have kept the example above the package's new floor.
0.1.2 #
- Upgraded native BooleanMaths Android SDK dependency to
1.0.8. It adds automatic tracking: anapp_openedevent on every launch and aFirstOpenevent, with attribution data, on the first one. These arrive without anytrackEventcall of your own — check for a hand-rolled app-open event that would now be a duplicate. - Documented
handleNotificationIntentin the README, including which payload entries survive the crossing to Android (flatString,bool,intanddoubleonly).
0.1.1 #
- Upgraded native BooleanMaths Android SDK dependency to
1.0.7. - Added
BooleanMaths.handleNotificationIntentto support manual tracking of notification clicks and intents on Android. - Automatically registers SDK wrapper configuration (identifying as
flutterversion0.1.1) during initialization.
0.1.0 #
No API changes — a documentation fix plus a version-range correction.
- Fixed the README quick-start, which called
BooleanMaths.initialize()beforerunApp()withoutWidgetsFlutterBinding.ensureInitialized(). Copying that snippet threwServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized. - Moved off
0.0.xso callers can depend on^0.1.0and receive patches. A^0.0.1constraint resolves to>=0.0.1 <0.0.2, which would have pinned every consumer to a single version.
0.0.1 #
Initial release.
BooleanMaths.initialize(apiKey:, pixelId:)— initializes the native SDK.BooleanMaths.trackEvent(name, properties:)— records an event with typed properties (String,num,bool,List,Map). Null values and non-string keys are dropped natively so one bad property never costs the whole event.BooleanMaths.getPlatformVersion()— channel smoke test.- Android support (minSdk 24), backed by
com.booleanmaths:bm-sdk:1.0.5. - iOS registers the channel but tracking calls are safe no-ops — there is no native BooleanMaths iOS SDK yet.