localytics_flutter_sdk 1.0.3
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 the1.0.1release. Snippet now reads^1.0.3andtool/sync_plugin_version.dartkeeps it in sync withpubspec.yamlon every future bump, so this drift cannot recur.
Changed #
android/build.gradle:minSdkraised from21to24to match Flutter stable's enforced runtime floor. The previous21value was effectively dead —flutter runalready 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.dartnow also rewrites the install snippet inREADME.md(thelocalytics_flutter_sdk: ^X.Y.Zline under "Installation"). All version-bearing files are still derived frompubspec.yamlas the single source of truth.
1.0.2 - 2026-05-29 #
Fixed #
-
The wrapper-version tag (
plugin_library→Flutter_<version>) used to be applied from the plugin'sonAttachedToEngine/register(with:)hook, which runs after the host'sApplication.onCreate/AppDelegatehas already calledLocalytics.Builder().autoIntegrate(this)/Localytics.builder().build().autoIntegrate(). Because the native SDK snapshotslibrary_versioninto each session header at session-open time, the very first session(s) of every cold launch reportedlv=androida_<native>:<native>/iosa_<native>:<native>instead ofandroida_<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'sAndroidManifest.xml. Android resolves declared providers inApplication.attachBaseContext()— beforeApplication.onCreateruns — which is the same library-init mechanism AndroidX Startup, Firebase, and WorkManager use. The provider isandroid:exported="false"and its authority is namespaced with${applicationId}.localytics_flutter_plugin_initto 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 — beforemain()returns and therefore beforeUIApplicationDelegate.application:didFinishLaunchingWithOptions:gets a chance to callautoIntegrate. Mirrors the React Native wrapper'smyStaticInitMethodpattern.
The existing in-engine
tagWrapperLibraryVersion()calls insideonAttachedToEngine/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.2from session 1 (previously sessions opened before plugin attach reported the native default). - Android: a hidden
Changed #
tool/sync_plugin_version.dartnow 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 remainspubspec.yaml.
1.0.1 - 2026-05-29 #
Fixed #
- Android: diagnostic getters (
getInstallId,getCustomerId,getIdentifier,getPushRegistrationId,getAppKey,getLibraryVersion) threwPlatformException(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 backgroundioExecutorand 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.*, andLocalyticsEnv.xcconfigare 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_sdksoGeneratedPluginRegistrantcan@import localytics_flutter_sdk; library product remainslocalytics-flutter-sdkfor Flutter's generated linker.
0.0.2 - 2026-05-25 #
Fixed #
- iOS builds failed with
Module 'localytics_flutter_sdk' not foundwhen the plugin was consumed from pub.dev via Swift Package Manager. The Swift target is nowlocalytics_flutter_sdk(matchingGeneratedPluginRegistrant's@import), and the SPM library product remainslocalytics-flutter-sdkfor 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.0via thehttps://maven.localytics.com/publicMaven repository. - iOS: depends on the official
Localytics-swiftpmpackage, pinned to7.1.1exactly 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).
- Privacy and logging controls (
- 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 reportandroida_<native>:Flutter_<plugin>(and the iOS equivalent) instead of the default<native>:<native>. Exposed to Dart asLocalytics.pluginVersion. - Location monitoring toggles:
setLocationMonitoringEnabledandpersistLocationMonitoringon Android and iOS. - Apache-2.0 license.
Fixed #
- Android inbox maps now include
nameanddeleted. - 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; rundart run tool/sync_plugin_version.dartto sync Dart/Kotlin/Swift.
Deferred (for future iterations) #
- Listener-style callbacks (
AnalyticsListener,MessagingListener,LocationListener,CallToActionListener) — requireEventChannel. - In-app message dismiss button image customization (requires
Bitmap/UIImagemarshalling). - Advanced geofencing / Places (
setLocation,triggerRegion,geofencesToMonitor, location listeners). - Inbox detail view controller (
inboxDetailViewControllerForCampaign). - Manual integration hooks (
Localytics.integrate,Localytics.onActivityResume,Localytics.onActivityPause,Localytics.onNewIntent).