pug_flutter 0.0.5
pug_flutter: ^0.0.5 copied to clipboard
Pug analytics, identity, session tracking, and event batching SDK for Flutter.
0.0.5 #
- Breaking: remove campaign capture, push device registration, and device
subscription from the public API. The backend does not accept them yet, so
shipping the entry points invited calls that could not succeed. The code stays
in the package and the features will be turned back on in a later release.
package:pug_flutter/pug_flutter.dartno longer exportsPugPush,PushProvider,PushSubscription,PushSubscribeOptions,PugLinkProvider,AppLinksPugLinkProvider, orcampaignPropertiesFromUri.PugOptionsno longer hasautoCaptureCampaignsorlinkProvider, and no campaign auto-properties ($utmSource,$gclid, and the rest) are attached to events.PugTransportno longer declaressubscribeDevice; a custom transport does not have to implement it. It moved to an internalPugDeviceTransportthatConnectPugTransportstill implements.
- The
notification_clicked,notification_received, andnotification_dismissedevent kinds are unaffected: they are ordinary events on the live events endpoint, still reachable throughPug.track.*andPugEventNames. - Add automatic
app_installandapp_updatetracking, controlled by the newPugOptions.autoInstallEvents(default on, independent ofautoTrack).app_installis emitted on the first launch the SDK sees on a device, andapp_update— carryingpreviousVersion— on the first launch after the app version changes. Detection compares the$appVersionauto-property against a version persisted under__pug_<projectId>_last_version__, so it is inactive when a customPugAutoPropertyProvidersupplies no app version. The install event is suppressed when other Pug state is already on the device, so adding this SDK to an app that already used Pug does not report its existing users as new installs.Pug.destroy()clears that state, so a destroy/re-init cycle does look like a fresh install.
0.0.4 #
- Add the
$deviceTypeauto-property, reporting the form factor astv,mobile, ordesktop. Android TV is detected from the device's system features rather than the operating system, which reports plainandroidthere;$platformstaysandroidso the value keeps matching the other Pug SDKs. Omitted on web, where the host device is not detectable from Dart. - Fix
$deviceModelshipping the literal"Unknown device"/"Unknown Model"placeholders thatdevice_info_plusreturns when its marketing-name lookup misses. Those now fall back to the device identifier (iPhone,MacBookPro18,3). macOS was affected on any Mac absent from the plugin's table, which previously had no placeholder check at all. - Omit
$osVersionwhen the device-info payload has no version, instead of sending an empty string that overwrote thePlatform.operatingSystemVersionfallback. - Derive
$platformfromPlatform.operatingSysteminstead ofdefaultTargetPlatform, so$platformand$osare one value from one source. No change to the value on any supported platform: this removes a lookup table, a debug-only spoofing vector, and aFlutterErrorthatdefaultTargetPlatformraises on targets outside its six-member enum. - Include the underlying error in the auto-property warning logs, which previously reported only that a category had failed.
0.0.3 #
- Fix the
$platformauto-property to send the cross-SDK lowercase value set:web,android,ios,macos,linux,windows,fuchsia. It previously came fromdefaultTargetPlatform.name, which keeps the enum's casing, so this SDK reportediOS/macOSwhere the rest of the Pug SDKs sendios/macos. The backend promotes$platforminto a dedicated column verbatim, so the mismatch split one platform into per-SDK buckets in any cross-SDK breakdown. - Fix
$platformon Flutter web, which reported the browser's host OS rather thanweb— a web app on an iPhone was indistinguishable from native iOS traffic.$platformis now alwayswebthere, and equals$oson every native target. - Document the auto-properties attached to every event in the README.
Dashboards, filters, or saved segments that match the old iOS/macOS casing
(or that treated Flutter web traffic as iOS) need updating to the lowercase set.
0.0.2 #
- Replace the
connectrpcdependency with a hand-rolled native Connect unary transport overpackage:http. This drops thedependency_overrides: protobuf: ^6.0.0workaround that 0.0.1 forced consumers to add: the SDK now resolves cleanly against theprotobuf6.x runtime the generated code requires. Connect error bodies are parsed forcode/message; permanent codes drop the batch while transient/unknown errors (e.g.SocketException) retry. - Add a runnable example app under
example/.
0.0.1 #
Initial release.
- Analytics
trackAPI: untypedPug.track('kind', props: {...})plus codegen'd typedPug.track.<event>(...)methods for well-known events, with compile-time checking of required fields and value types. - Identity, sessions, and device registration:
init,identify,reset,rotate,flush, and asyncdestroy()(awaits a best-effort final flush before teardown; the singleton detaches synchronously so a follow-upinit()is safe). identify()first-call anonymous-ID merge and device-ID linking.identify()never throws;init()throws synchronously only on invalid input (emptyprojectId/apiKey) and otherwise logs and swallows setup failures.- Batched binary-protobuf transport over Connect with lock/commit/rollback queue persistence; offline/transient failures retry, permanent failures drop.
- Tracking-consent gate (opt in/out, optional persistence) over track, identify, and automatic capture.
- Mobile auto-properties, app-lifecycle auto-tracking (
app_open/app_close), and automatic campaign capture from app/deep links (requiresapp_links6.x). - Auto page-views via
PugRouteObserver: route changes emitscreen_view(with ascreenNameproperty) on iOS/Android andpage_viewon web; every event also carries$url/$referrerauto-properties. Desktop emits no navigation event. $timezonereports the IANA identifier (e.g.Asia/Kolkata), falling back to the platform abbreviation when unavailable;$deviceNameis intentionally not sent (PII).- Provider-neutral push registration with notification
received/clicked/dismissed helpers (all sent immediately; a missing, empty, or
non-string
campaignIddefaults to(unknown)). - Pluggable storage (
SharedPreferencesdefault, in-memory opt-out), logger, clock, and ID generator.