Skip to content

v0.1.0

Latest

Choose a tag to compare

@Franklyn-R-Silva Franklyn-R-Silva released this 04 Dec 12:27
d462308

The first release: Firebase-style in-app messaging for Flutter, with the campaigns in your Supabase Postgres.

  • Campaign schema: iam_campaigns (layout, content, buttons, trigger events, schedule, priority and audience) and iam_campaigns_for, which returns the campaigns eligible for the caller (#2).
  • Widgets: InAppMessage.tryParse reads a campaign from iam_campaigns_for, and showInAppMessage shows it as a banner, modal or card themed from Theme, with a builder to replace any layout, swipe, back and tap-outside dismissal, and screen-reader, large-text, safe-area and tablet support (#4).
  • An example app in example/ that shows a campaign as a banner, a modal and a card, and a README with the reference in docs/ (#20).
  • Campaigns: max_app_version shows a campaign only below that version (exclusive), for an update prompt; it must be above min_app_version when both are set (#11).
  • Client: InAppMessaging.initialize fetches the campaigns for the signed-in user from iam_campaigns_for, again on every sign-in, sign-out or user switch, and trigger(event) shows the highest-priority one for the event, with app_open on start and resume, one message at a time, messagesSuppressed and a shouldShow veto (#19, #3).
  • Frequency caps: max_impressions, min_interval and stop_after_click per campaign, held on the server for signed-in users through iam_events and iam_track, and on the device per project and user (#5).
  • Offline cache and metrics: the campaigns last fetched are cached per project and user, so app_open shows one at an offline launch, and their images are warmed in memory after each fetch; events wait in a queue on the device (the newest 100 per user) and go in batches to iam_track(p_events jsonb), which keeps the device's time within the last 7 days, skips bad elements and keeps at most 300 events per user per hour; the iam_campaign_stats view sums impressions, clicks, click-through rate, dismissals and unique users per campaign and UTC day, and iam_prune_events deletes old events (#7, #8).
  • Translations: translations holds a campaign's title, body and button texts per locale, and iam_campaigns_for picks the one for the locale the client sends (the exact tag, then its language, then the campaign's own, per field), never sending the map (#14).
  • service_role is granted what it needs by name: writing campaigns, reading and deleting events, reading the stats and calling iam_campaigns_for and iam_prune_events, so a project without Supabase's default grants works too; the SQL tests run with and without them.
  • Live updates: each change to iam_campaigns sends an empty "changed" signal on the private Realtime topic in_app_messaging, which clients can receive and not send, and the client fetches again a random 1 to 5 seconds later; it also fetches when the app is shown again and when the channel joins again after a drop, and dispose() leaves the channel (#6).
  • FakeInAppMessaging in package:supabase_in_app_messaging/testing.dart: an in-memory InAppMessaging for widget tests of apps that show messages; trigger follows the client's rules and events holds the recorded impressions, clicks and dismissals (#12).

What's Changed

Other changes

New Contributors

Full Changelog: https://github.com/Franklyn-R-Silva/supabase_in_app_messaging/commits/v0.1.0