pug_flutter 0.0.4
pug_flutter: ^0.0.4 copied to clipboard
Pug analytics, identity, session, batching, and push device-registration SDK for Flutter.
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.