Repository navigation
3.0.0
This release narrows the public API and is a major version. Migration:
- Use
EventType.rawValuefor the SNAKE_CASE wire value.EventType.x.namenow returns the Dart enum name ("addToCart"), and code that relied onnamecompiles unchanged but gets the camelCase value. - Remove any
import 'package:appstack_plugin/appstack_plugin_method_channel.dart'. To fake the plugin in tests, extendAppstackPluginPlatformwithMockPlatformInterfaceMixinand setAppstackPluginPlatform.instance. AppstackPlugin()no longer compiles. Call the static methods directly.- Remove
isDebug:andendpointBaseUrl:fromconfigure()calls. Neither had any effect. UselogLevel: 0for verbose logging. sendEvent()returnsFuture<void>. Stop branching on its result;awaitworks unchanged.- Replace
getAttributionParamsWithCallback()withawait getAttributionParams(), which now waits for the attribution match on both platforms. getAttributionParams()never returns null. Drop null checks and treat an empty map as "no attribution".
Added
EventType.rawValue: the SNAKE_CASE value sent to the native SDKs (e.g.EventType.addToCart.rawValue→"ADD_TO_CART").sendEventnow uses it. What reaches the native SDKs is unchanged.
Changed
AppstackPluginPlatformis documented as the supported way to fake the plugin in an app's unit tests.- Breaking:
sendEvent()returnsFuture<void>instead ofFuture<bool>. Both platforms always returnedtrue, even when the native SDK went on to drop the event (a manual install, a disabled SDK), so the value implied a delivery guarantee it never had. React Native made the same change in 3.0.0. - Breaking:
getAttributionParams()returnsFuture<Map<String, dynamic>>instead ofFuture<Map<String, dynamic>?>. When there is nothing to report it returns an empty map, so callers no longer need to handle both null and empty. - Breaking:
AppstackPluginPlatform.sendEventandAppstackPluginPlatform.getAttributionParamschanged the same way, so test fakes that override them need the new return types. - Android: The plugin's Android code is now written in Java and no longer applies the Kotlin Gradle Plugin. Apps on recent Flutter versions no longer see the "plugins that apply Kotlin Gradle Plugin (KGP)" warning for this plugin, and it keeps building once Android Gradle Plugin 10 removes the option to opt out of built-in Kotlin. Behavior and the Dart API are unchanged, and the plugin still builds on Flutter 3.24.
Fixed
- Android: Attribution params could sometimes be missing. When
getAttributionParams()was called shortly afterconfigure(), it could return an empty map before the attribution match had finished, so values such asappstack_adnetworkandappstack_campaignwere missed and never reached your integrations. It now waits for the match to finish before returning, as it already did on iOS. - iOS:
configure(logLevel:)now means the same on iOS as on Android and in the docs (0=DEBUG, 1=INFO, 2=WARN, 3=ERROR). iOS mapped the numbers in the wrong order:logLevel: 0turned logging off, the default1showed only errors,2was debug and3was info. iOS has no warn level, so2and3both show errors only. If you passed alogLevelto get specific iOS output, check it against the levels above.
Removed
- Breaking:
EventTypeExtension. Itsnamegetter shadowed Dart's built-inEnum.name, so the same expression returned"ADD_TO_CART"or"addToCart"depending on the variable's static type and imports (for example through anEnum-typed variable, a generic helper, orimport ... show EventType), andEventType.values.byName(e.name)threw.EventType.x.nameis now Dart's built-in enum name; userawValuefor the wire value. - Breaking:
package:appstack_plugin/appstack_plugin_method_channel.dart. The method-channel implementation moved tolib/src/and is no longer importable. - Breaking: the implicit public
AppstackPlugin()constructor. The class is static-only. - Breaking:
configure()'sisDebugandendpointBaseUrlparameters. Both were deprecated and had no effect. React Native removed them in 3.0.0. - Breaking:
getAttributionParamsWithCallback(), and theappstack_plugin/attribution_paramsevent channel behind it. It existed because Android'sgetAttributionParams()used not to wait for the attribution match. Now that it does, the stream returned the same value asgetAttributionParams().