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