pingwindot_notifications 0.5.0
pingwindot_notifications: ^0.5.0 copied to clipboard
Native Android notification service for PingWinDot — shows FCM signals with confirm/acknowledge action buttons in the system tray and sends the reaction to Supabase RPC without launching a Flutter isolate.
Changelog #
0.5.0 #
- New: "Сонце" signal support (
sound_type == "3").sound_typerange widened from0..2to0..3(previously a"3"was silently coerced to2and played the alarm sound).- New bundled sound
res/raw/pingwin_sound_sun.wav— a distinct informational tone, deliberately less alarming than level 2. - New vibration pattern for level 3: soft triple-tick
(
0, 60, 80, 60, 80, 60).
- New: second action button on "Сонце" pushes. Level-3 notifications show
two actions — "Бачив" (acknowledge, left) and "Прийняв +" (report, right),
mirroring the in-app tile layout. "Бачив" calls the Supabase RPC
acknowledge_notification_status(p_descriptor := ...)→ sets recipient status 3 ("Ознайомлений"); "Прийняв +" keeps callingconfirm_notification_statusunchanged. Same native auth flow (mirrored session + 401 refresh retry) for both.- Requires the host DB to expose
acknowledge_notification_status(p_id text, p_descriptor text). - New broadcast action
dev.pingwindot.notifications.ACTION_SEENdeclared in the plugin manifest.
- Requires the host DB to expose
- New: in-app sun sound as a package asset.
packages/pingwindot_notifications/assets/audios/sun_signal.wav(see thepingwindotSunSignalAssetDart constant) — byte-identical to theres/rawfile, so foreground (Dart) and background (native) playback stay in sync. - Levels 0–2 behaviour, pref keys, and the FCM payload contract are unchanged;
level 3 is intentionally not mutable via
notifMuteLevel*(an informational signal that must always be audible when sound is on).
0.4.1 #
- Breaking pref-key rename so the plugin can be driven directly by
FlutterFlow App State (Persisted Boolean) fields. Old keys
pingwin.notif_*are no longer read; new keys mirror the FF persistence conventionflutter.ff_<fieldName>:notifSoundEnabled(waspingwin.notif_sound_enabled)notifVibrationEnabled(waspingwin.notif_vibration_enabled)notifMuteLevel0/notifMuteLevel1/notifMuteLevel2(waspingwin.notif_mute_level_*)
- No-op for hosts that have not yet written any of these — the legacy
pingwin_signalsfallback still kicks in, so 0.3.0-style behaviour is preserved out of the box. app_in_foregroundflag remains underflutter.pingwin.app_in_foreground(plugin-managed, not exposed via FF App State).
0.4.0 #
- New: per-level sound on push receipt. Bundles three notification sounds
in
android/src/main/res/raw/(pingwin_sound_default.mp3,pingwin_sound_warning.wav,pingwin_sound_alarm.mp3) and selects one based on the newsound_typedata field ("0"/"1"/"2"). Plays viaMediaPlayerwithUSAGE_NOTIFICATIONfrom the FCM service, so it works even when the app is killed. - New: per-level vibration patterns.
0→ short tick,1→ double-tap,2→ long alarm × 3. UsesVibrationEffect.createWaveformon API 26+ with legacy fallback. - New: SharedPreferences-driven control. Five keys (see
PingwindotPrefs): global sound/vibration switches plus per-level mute. Defaults to legacy v0.3.0 behaviour (system sound onpingwin_signalschannel) until the host writes any notif-pref, then switches to the new silent channelpingwin_signals_v2and drives sound/vibe natively. - New: foreground dedup.
PingwindotNotifications.setForegroundState(bool)flips a flag the FCM service reads to skip native sound/vibe when the in-app Dart handler is active. - New: Dart plugin API.
PingwindotNotificationsclass withsetForegroundState. The plugin is no longer Dart-API-less. - New manifest channel id:
pingwin_signals_v2is now thedefault_notification_channel_id. The legacypingwin_signalschannel remains for the fallback path. - Manifest now declares
<uses-permission android:name="android.permission.VIBRATE"/>. - No FCM payload contract change beyond the optional
sound_typefield. - Drop-in compatible with 0.3.0 hosts that don't write any notif-pref.
0.3.0 #
- Localised all user-facing strings to Ukrainian (the plugin is purpose-built
for the PingWinDot signal app, which is Ukrainian-only):
- Action button label: "+" → "Прийняв +"
- Progress subtext: "Sending acknowledgement…" → "Надсилаємо …"
- Success body: "Acknowledgement received ✓" → "прийнято ✓"
- Channel name: "PingWin Signals" → "Сигнали PingWin"
- Channel description updated accordingly.
- Added brand accent colour
#3498DBviasetColor()on all three notification states (initial, progress, success). On Material You (Android 12+) this colourises the action button text; on older versions it tints the small icon. - No payload / RPC contract changes — drop-in compatible with 0.2.0 hosts.
0.2.0 #
- Breaking: FCM data payload now expects field
descriptorinstead ofrecipient_id. Edge function on the host side must includedescriptor(the uniquenotification_recipients.descriptorvalue) rather than the row id. - Breaking: RPC call now passes
p_descriptorinstead ofp_id. The host's Supabase RPCconfirm_notification_statusmust accept ap_descriptor textparameter and look up the row by descriptor (which isUNIQUEin the schema and equals<notification_id>-<munit_id>). - No edge-function lookup is required to find the descriptor — it can be
constructed deterministically from
notification_idandmunit_id, although hosts may keep the lookup as a sanity check.
0.1.0 #
- Initial release.
- Android-only Flutter plugin contributing:
PingWinFcmService—FirebaseMessagingServicesubclass that intercepts data-only FCM payloads and renders a heads-up notification with a single "+" action button.NotificationActionReceiver— handles taps on the action button, calls Supabase RPCconfirm_notification_status(p_id := recipient_id), with native access-token refresh on 401.SupabaseAuthHelper— reads mirrored session from SharedPreferences, serialises refresh through aFileLockto prevent rotation races with the supabase_flutter SDK.
- No Dart API surface — host app integrates via:
- AndroidManifest
<meta-data>for Supabase URL and anon key. - SharedPreferences key
pingwin.session(Dart writes mirrored session, plugin readsflutter.pingwin.sessionnatively).
- AndroidManifest
- Edge function payload contract: data-only fields
notification_id,recipient_id,title,body.