localytics_flutter_sdk 1.0.3 copy "localytics_flutter_sdk: ^1.0.3" to clipboard
localytics_flutter_sdk: ^1.0.3 copied to clipboard

Flutter plugin for the Localytics analytics, push, and engagement SDK on Android and iOS.

Changelog #

All notable changes to this plugin are documented in this file.

The format is based on Keep a Changelog, and this plugin adheres to Semantic Versioning.

[Unreleased] #

1.0.3 - 2026-05-29 #

Fixed #

  • README's install snippet pinned to ^1.0.0, which became stale immediately after the 1.0.1 release. Snippet now reads ^1.0.3 and tool/sync_plugin_version.dart keeps it in sync with pubspec.yaml on every future bump, so this drift cannot recur.

Changed #

  • android/build.gradle: minSdk raised from 21 to 24 to match Flutter stable's enforced runtime floor. The previous 21 value was effectively dead — flutter run already refuses devices below API 24, so no Flutter app could ever exercise this plugin at API 21–23. The new declaration honestly reflects the only API band where the plugin actually runs.
  • tool/sync_plugin_version.dart now also rewrites the install snippet in README.md (the localytics_flutter_sdk: ^X.Y.Z line under "Installation"). All version-bearing files are still derived from pubspec.yaml as the single source of truth.

1.0.2 - 2026-05-29 #

Fixed #

  • The wrapper-version tag (plugin_libraryFlutter_<version>) used to be applied from the plugin's onAttachedToEngine / register(with:) hook, which runs after the host's Application.onCreate / AppDelegate has already called Localytics.Builder().autoIntegrate(this) / Localytics.builder().build().autoIntegrate(). Because the native SDK snapshots library_version into each session header at session-open time, the very first session(s) of every cold launch reported lv=androida_<native>:<native> / iosa_<native>:<native> instead of androida_<native>:Flutter_<plugin> / iosa_<native>:Flutter_<plugin>.

    Fixed by tagging the wrapper version at library-load time on both platforms:

    • Android: a hidden ContentProvider (LocalyticsPluginInitProvider) declared in the plugin's AndroidManifest.xml. Android resolves declared providers in Application.attachBaseContext() — before Application.onCreate runs — which is the same library-init mechanism AndroidX Startup, Firebase, and WorkManager use. The provider is android:exported="false" and its authority is namespaced with ${applicationId}.localytics_flutter_plugin_init to avoid collisions across host apps.
    • iOS: a __attribute__((constructor)) C function in the Objective-C bridge target. The dynamic linker invokes the constructor when the dylib is loaded — before main() returns and therefore before UIApplicationDelegate.application:didFinishLaunchingWithOptions: gets a chance to call autoIntegrate. Mirrors the React Native wrapper's myStaticInitMethod pattern.

    The existing in-engine tagWrapperLibraryVersion() calls inside onAttachedToEngine / register(with:) are kept as harmless idempotent refreshers — setOption("plugin_library", same_value) is a no-op in the native SDK.

    Verified on a fresh Android install: every session header in a clean run now reports lv=androida_7.1.0:Flutter_1.0.2 from session 1 (previously sessions opened before plugin attach reported the native default).

Changed #

  • tool/sync_plugin_version.dart now also generates a private Objective-C header (ios/.../localytics_flutter_objc/LocalyticsFlutterPluginVersion.h) carrying the version string, consumed by the dylib-load constructor above. Plugin version source of truth remains pubspec.yaml.

1.0.1 - 2026-05-29 #

Fixed #

  • Android: diagnostic getters (getInstallId, getCustomerId, getIdentifier, getPushRegistrationId, getAppKey, getLibraryVersion) threw PlatformException(LOCALYTICS_ERROR, Cannot be called on the main thread.) because the plugin invoked the native SDK directly from the Flutter platform thread. These calls are now dispatched onto the plugin's background ioExecutor and the result is posted back via the main looper, mirroring the existing inbox pattern. iOS was unaffected.

Changed #

  • The example/ app is now included in the published package so customers can browse a working integration on pub.dev (and the package picks up the analyzer's "Package has an example" points). Real Localytics app keys remain protected: .env, .env.*, and LocalyticsEnv.xcconfig are gitignored and excluded from the package automatically.

1.0.0 - 2026-05-27 #

First stable release on pub.dev as localytics_flutter_sdk. Wraps Android SDK 7.1.0 and iOS SDK 7.1.1 with documented host-app setup for production Android and iOS builds (SPM on iOS, Maven + localytics.xml on Android).

0.0.3 - 2026-05-27 #

Fixed #

  • iOS SwiftPM integration: Swift target renamed to localytics_flutter_sdk so GeneratedPluginRegistrant can @import localytics_flutter_sdk; library product remains localytics-flutter-sdk for Flutter's generated linker.

0.0.2 - 2026-05-25 #

Fixed #

  • iOS builds failed with Module 'localytics_flutter_sdk' not found when the plugin was consumed from pub.dev via Swift Package Manager. The Swift target is now localytics_flutter_sdk (matching GeneratedPluginRegistrant's @import), and the SPM library product remains localytics-flutter-sdk for Flutter's generated plugin package linker.

0.0.1 - 2026-05-25 #

Initial release on pub.dev as localytics_flutter_sdk (Android SDK 7.1.0, iOS SDK 7.1.1).

Added #

  • Initial Flutter plugin wrapping the Localytics native SDKs.
  • Android: depends on com.localytics.androidx:library:7.1.0 via the https://maven.localytics.com/public Maven repository.
  • iOS: depends on the official Localytics-swiftpm package, pinned to 7.1.1 exactly via Swift Package Manager — matching the Maven pin on the Android side so both halves of the plugin track the same tested native SDK release.
  • Public Dart API surface covering:
    • Privacy and logging controls (setLoggingEnabled, setOptedOut, setPrivacyOptedOut).
    • Session and upload control (openSession, closeSession, upload, setSessionTimeoutInterval).
    • Core analytics (tagEvent, tagScreen, setCustomDimension, setIdentifier).
    • Common ecommerce events (tagPurchased, tagAddedToCart, tagStartedCheckout, tagCompletedCheckout, tagContentViewed, tagSearched, tagShared, tagContentRated, tagInvited).
    • Customer identity (setCustomerId, setCustomerEmail, setCustomerFirstName, setCustomerLastName, setCustomerFullName, tagCustomerRegistered, tagCustomerLoggedIn, tagCustomerLoggedOut).
    • Profile attributes (setProfileAttribute, deleteProfileAttribute, addProfileAttributesToSet, removeProfileAttributesFromSet, incrementProfileAttribute, decrementProfileAttribute).
    • In-app messaging (triggerInAppMessage, dismissCurrentInAppMessage, setInAppMessageDismissButtonLocation, triggerSessionStartInAppMessages, enableDarkMode).
    • Test mode toggles (setTestModeEnabled, isTestModeEnabled).
    • Upload control (pauseDataUploading).
    • GDPR convenience (setCustomerIdWithPrivacyOptedOut).
    • Diagnostic getters (getCustomerId, getIdentifier, getPushRegistrationId, getInstallId, getAppKey, getLibraryVersion).
    • Push (cross-platform): setPushRegistrationId, handleTestModeURL.
    • Push (Android-only): registerPush, handleFirebaseMessage, tagPushReceivedEvent — exposed as graceful no-ops on iOS.
    • Push (iOS-only): didReceiveNotificationResponse, handleNotification, handleNotificationReceived, didRequestUserNotificationAuthorization, didRegisterNotificationSettings — exposed as graceful no-ops on Android.
    • App Inbox (getInboxCampaigns, refreshInboxCampaigns, getAllInboxCampaigns, refreshAllInboxCampaigns, getInboxCampaignsUnreadCount, setInboxCampaignRead, deleteInboxCampaign, inboxListItemTapped).
  • New Dart models: Customer, InboxCampaign, ProfileScope, InAppDismissButtonLocation.
  • Automatic wrapper-version tagging: both platform plugins now call Localytics.setOption("plugin_library", "Flutter_<pluginVersion>") on attach so analytics payloads report androida_<native>:Flutter_<plugin> (and the iOS equivalent) instead of the default <native>:<native>. Exposed to Dart as Localytics.pluginVersion.
  • Location monitoring toggles: setLocationMonitoringEnabled and persistLocationMonitoring on Android and iOS.
  • Apache-2.0 license.

Fixed #

  • Android inbox maps now include name and deleted.
  • Android plugin shuts down background executor on engine detach.
  • Consumer ProGuard rules for release builds (android/proguard-rules.pro).

Changed #

  • Plugin version centralized in pubspec.yaml; run dart run tool/sync_plugin_version.dart to sync Dart/Kotlin/Swift.

Deferred (for future iterations) #

  • Listener-style callbacks (AnalyticsListener, MessagingListener, LocationListener, CallToActionListener) — require EventChannel.
  • In-app message dismiss button image customization (requires Bitmap/UIImage marshalling).
  • Advanced geofencing / Places (setLocation, triggerRegion, geofencesToMonitor, location listeners).
  • Inbox detail view controller (inboxDetailViewControllerForCampaign).
  • Manual integration hooks (Localytics.integrate, Localytics.onActivityResume, Localytics.onActivityPause, Localytics.onNewIntent).
0
likes
160
points
125
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter plugin for the Localytics analytics, push, and engagement SDK on Android and iOS.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on localytics_flutter_sdk

Packages that implement localytics_flutter_sdk