notiblast_sdk 0.9.0
notiblast_sdk: ^0.9.0 copied to clipboard
Flutter push-notification SDK for the NotiBlast backend: FCM device registration, tray display, inline reply, and chat-style conversation notifications.
0.9.0 #
- Android:
setReplyHandlergetsdismissOnReply, a function that decides which notifications are removed from the tray after a successful reply instead of staying there. When the removed notification was the last one in its group, the group summary is removed too. Without it, nothing changes. Ignored on iOS.
0.8.2 #
- iOS:
NotiBlastCommunicationgetsinitialsFallback(defaulttrue). Set it tofalseto skip the initials avatar whenavatarURLisnilor fails to load — the communication notification then shows the app icon, e.g. for a company logo avatar.
0.8.1 #
- Docs: README now links to the NotiBlast website and dashboard.
- Package metadata:
homepagepoints to notiblast.com; addedrepository.
0.8.0 #
- Android 11+: conversation notifications now use the platform's conversation look —
they appear in the Conversations section with the conversation's avatar as the
large icon and a small app icon badge. The SDK links each conversation to a long-lived
shortcut (ID =
conversationId); recent conversations can also show in the app icon's long-press menu. New optionalNotiBlastConversation.conversationAvatarUrlsets the avatar, padded so the round mask doesn't cut its edges; without it,defaultAvatarDrawableor an initials avatar (first letters of the first two words of the new optionalavatarName, else the title: "Team Cicle" → "TC") is used. Below Android 11 nothing changes. - iOS 15+: chat pushes can be shown as communication notifications — avatar with a small
app icon badge, group or sender name as the title. Override the new
NotiBlastNotificationService.communication(groupKey:data:)in your Notification Service Extension to return aNotiBlastCommunication; the defaultnilkeeps the current look. Needs the Communication Notifications capability and twoInfo.plistentries — see "Chat notifications on iOS" in the README. Without an avatar the SDK draws an initials avatar from the new optionalNotiBlastCommunication.avatarName, else the group or sender name. In the foreground iOS shows these pushes itself andshowNotification()skips them (markeddata['notiblast_communication'] == 'true'). Avatars in any format ImageIO decodes (WebP, HEIC, BMP, ...) are converted to PNG (at most 256 px) — iOS can't show a WebP avatar; undecodable ones (SVG, HTML) use the initials avatar. Avatars are cached per URL for 30 days (100 files / 20 MB) in the extension, so a slow network doesn't fall back to initials for a logo it already has. TheNotiBlastNSEpod now also linksIntentsandCryptoKitand has new files — runpod install. NotiBlast.logout()now also removes those conversation shortcuts on Android and the messages donated for communication notifications on iOS.- Android 12+: an animated GIF or WebP
image_urlin a regular notification now plays in the big picture. The notification is first shown as before, then reposted silently with the animated image. Tap, reply and timeout keep working. Below Android 12, or if the repost fails, the first frame is shown as before. - Android:
androidx.core:coredependency raised from 1.3.0 to 1.13.1 (needed for the shortcut APIs). Gradle picks the highest version in your app, so no action is needed unless your app pins an older one. - Fix (Android): two pushes for the same conversation arriving at the same time no longer drop a message from the conversation notification. Conversation pushes are now shown one after another per conversation.
0.7.1 #
- iOS: push images in formats iOS can't attach (WebP, BMP, AVIF, ICO, TIFF, ...) are
now shown.
NotiBlastNotificationServiceconverts them to JPEG (first frame, at most 1024 px on the longest side) before attaching; JPEG, PNG, GIF and HEIC are attached unchanged. Limitations: an animated WebP shows as a still image, transparent areas become white, and SVG is still not supported (the notification is shown without the image). TheNotiBlastNSEpod now also linksImageIO— runpod install. - iOS: animated GIFs in notifications shown while the app is in the foreground now
move. The image was always saved as
.jpg, so iOS showed it as a still image.
0.7.0 #
-
iOS: every push-token operation (device registration from
login()/ token refresh,logout(),optIn()/optOut(), topic (un)subscribe,Notifications.getToken(), token logging) now waits until the app is active. Reading the token while iOS launched the app in the background (e.g. for a notification reply) broke the APNs token mapping in FCM, so pushes failed withBadDeviceTokenuntil the app was opened.login()and reply delivery are not delayed. -
Added
NotiBlast.setLogHandler(): receive every SDK log line as aNotiBlastLogRecord(level, module, message, error, stack trace), so SDK logs are visible in Release / TestFlight builds. Can be set beforeinitAppId(). Logs never contain full push tokens, only their last 6 characters. The SDK now also logs FCM / APNs token fingerprints at startup, login, registration and token refresh. -
Added
NotiBlast.Notifications.setReplyHandler(): users can reply to a notification straight from the tray, without opening the app. The handler receives aNotiBlastReplyEventwith the typed text and the notification (including its fulldata). Pass acanReplyfunction to decide which notifications can be replied to (any rule you like, e.g.group_keystarting withgroupChat-), andactionTitle/placeholder/sendButtonTitleto change the labels. Both functions must be top-level or static and annotated@pragma('vm:entry-point'). Works on Android and iOS. -
iOS reply setup: call
NotiblastSdkPlugin.setupReply()inAppDelegate'sdidFinishLaunchingWithOptionsso replies work while the app is closed. Override the newcanReply(groupKey:data:)onNotiBlastNotificationService(NotiBlastNSE) to choose which pushes get Reply in the background (default: every push). On iOS the notification is removed from the tray after replying, and a reply that can't reach the handler in time is delivered on the next app start. -
Added
NotiBlast.Notifications.setConversationHandler()(Android): chosen notifications are shown as one conversation notification per chat that lists the latest messages (MessagingStyle). A top-leveltoConversationfunction decides which notifications become conversations and returns aNotiBlastConversation(sender, text, title, avatar); everything else is shown as before. Style it withNotiBlastConversationStyle(max messages, your own name and avatar, avatars on/off, fallback avatar drawable, group summary, round or square avatars viaNotiBlastAvatarShape), globally or per conversation. Downloaded avatars are resized to 192×192 and cropped round by default. Successful replies are added to the conversation. Also addedclearConversationHandler()andclearConversation(conversationId). -
Conversation notifications (Android) show the push
image_urlinside the message bubble, and older messages keep their image when the conversation updates. No API change: the SDK's manifest declares its ownFileProvider(<applicationId>.notiblast.fileprovider), so no host app setup is needed. If the image can't be downloaded, the message is shown as text only. -
Added an optional
timeoutAftertoNotiBlastNotification.showNotification(): the notification removes itself from the tray after that duration. On Android the OS removes it; on iOS the SDK does, keeping the app alive with a background task while it waits (best-effort, keep durations short — iOS grants about 30 seconds). Handy for short notices such as "reply not sent", even from a reply handler. A temporary notification keeps itsgroupIdbut doesn't post or update the group summary, and is never shown as a conversation or with the reply action, so the rest of the group stays as it was. Zero or negative durations are ignored. -
NotiBlast.initAppId()now clears the stored reply and conversation settings. CallsetReplyHandler()/setConversationHandler()afterinitAppId()on every app start.
0.6.0 #
- Breaking Removed
NotiBlast.Notifications.setBackgroundHandler()andNotiBlastNotification.fromBackgroundMessage(). Notifications that arrive while the app is in the background or terminated are always shown by the SDK. Delete your background handler and thesetBackgroundHandler()call; to keep a notification from reaching a user, filter it on the backend. - Breaking
NotiBlastNotification.showNotification()no longer takesandroidandiosarguments — call it without arguments. Notifications always use the SDK's display settings, so the payload'sgroup_keyandimage_urlare always applied. - Breaking
package:notiblast_sdkno longer re-exportsRemoteMessageor theflutter_local_notificationsdisplay types (AndroidNotificationDetails,DarwinNotificationDetails, and the types their fields take). If your app uses them for its own purposes, depend onfirebase_messaging/flutter_local_notificationsdirectly.
0.5.0 #
- Breaking Removed
NotiBlastNotification.isGroupSummaryand its constructor parameter. The SDK no longer reads theis_group_summarypayload field (it is still available indata). To check whether a notification is grouped, usenotification.groupId != null. - Changed On Android, a notification with a
group_keyis now posted as a group child, and the SDK posts one summary pergroup_keywithGroupAlertBehavior.children, so grouped notifications stack in the tray and only the new one alerts. No summary is posted on iOS or when you pass customandroiddetails toshowNotification(). - Changed On Android, a notification without an image now uses
BigTextStyleInformation, so a long body can be expanded and read in full instead of being cut off after one line. Notifications with an image still use a big picture.
0.4.1 #
- Fixed the click listener firing again for an already-handled local notification
tap after a hot restart. Android keeps the tap intent on the Activity, so
getNotificationAppLaunchDetails()kept reporting the old tap. The SDK now remembers the last dispatched tap ID and skips a launch tap with the same ID.
0.4.0 #
- Breaking (iOS) iOS notifications now arrive as alert pushes instead of silent
pushes, so they show up on time and even after the app was force-quit (iOS never
delivers silent pushes to a force-quit app). The backend must send iOS messages as
alerts with
mutable-content: 1; silent pushes to iOS are no longer supported. - Added
NotiBlastNSE, a CocoaPods library for an iOS Notification Service Extension. SubclassNotiBlastNotificationServicein your extension target (one line) and iOS alert pushes get the title/body from the payload, grouping fromgroup_key, and the image fromimage_url. See README → Step 4. - Changed (iOS) While the app is in the foreground, the system banner for FCM pushes
is held back: the notification reaches
addForegroundListenerand only appears if you callshowNotification()— the same as Android. Beforelogin()wires the listeners, a foreground push is not shown. - Changed
setBackgroundHandler()now applies to Android only — iOS alert pushes are displayed by the OS and never call it. - Fixed The default background handler no longer shows a second copy of a message that
carries an FCM
notificationblock (already displayed by the OS).
0.3.0 #
- Added
NotiBlast.Notifications.setBackgroundHandler(). Notifications that arrive while the app is in the background or terminated are still shown automatically by default, but an app can now take over: build the notification with the newNotiBlastNotification.fromBackgroundMessage()and callshowNotification()to display it, or return without displaying anything to drop it. The handler must be a top-level or static function annotated@pragma('vm:entry-point'), because FCM runs it in a separate isolate. Only one handler is used — the last call wins. - Added
RemoteMessageis re-exported frompackage:notiblast_sdk, so typing a background handler needs no direct dependency onfirebase_messaging. - Added
showNotification()takes optionalandroidandiosarguments (AndroidNotificationDetails/DarwinNotificationDetails) to replace the SDK's default display settings for that platform. A custom value is used as-is, so the payload'sgroup_key,is_group_summary, andimage_urlare not applied on that platform. - Added The notification display types from
flutter_local_notifications(AndroidNotificationDetails,DarwinNotificationDetails, style and attachment types, and related enums) are re-exported frompackage:notiblast_sdk, so passing custom settings needs no direct dependency onflutter_local_notifications. - Fixed On iOS, tapping a notification that arrived while the app was in
the background did nothing —
addClickListenernever fired. iOS runs the background handler in the main isolate while the app is alive, and it re-initialized the local notification plugin without a tap callback, replacing the one set up at login. It now keeps the existing tap callback. - Fixed On Android, dismissing or opening a notification could show an extra blank notification. Empty FCM messages (non-message broadcasts with no data) are now ignored.
0.2.0 #
- Changed
NotiBlastNotification.datanow decodes nested JSON values. FCM data values are always strings, so the backend sends nested objects (e.g.service,team) as JSON-encoded strings. Before, apps got those raw strings and crashed when treating them as maps. Now every string value that is a JSON object or array is decoded into aMap/List; plain strings and invalid JSON are kept as-is. Typed getters (title,body, ...) still read the original string. Apps thatjsonDecodethese values themselves must drop that step.
0.1.1 #
- Fixed notification images now time out after 10 seconds. Before, a slow or hanging image server made the SDK wait forever — in the background the OS killed the handler first and the notification was lost. Now the notification shows without the image, same as any other failed download.
0.1.0 #
- Added
NotiBlast.Notifications.removeClickListener(),removeForegroundListener()andremoveRegistrationErrorListener()— stop receiving events on a listener registered earlier, e.g. from a widget'sdispose(). Pass the same function reference you registered; anonymous closures can't be removed. Non-breaking: existing code keeps working. - Fixed adding or removing a listener from inside a listener callback no
longer throws
ConcurrentModificationError. - Changed
NotiBlast.Notificationscan now be accessed beforeNotiBlast.initAppId()without throwing, so listeners can be registered as early as you like. Methods that need Firebase still requireinitAppId()first. - Changed the SDK no longer logs the FCM token value or notification title/content from its dispatch paths — only whether a token is present. Internal logging coverage was also extended across the SDK.
0.0.1 #
- Initial release.
NotiBlast.initAppId(),NotiBlast.login(),NotiBlast.logout()— initialize the SDK and link/unlink this device to your user on the NotiBlast backend.NotiBlast.Notifications:requestPermission(),permission— OS notification permission.addClickListener(),addForegroundListener(),addRegistrationErrorListener()— notification and registration events.optOut()/optIn()— turn push notifications for this device off/on.subscribeTopic()/unsubscribeTopic()— join/leave FCM topics.clearAll(),removeGroupedNotifications()— manage the notification tray.getToken()— this device's FCM token.
NotiBlastNotification.showNotification()— show a foreground notification in the tray.- Data-only FCM messages are rendered by the SDK in all app states, with
grouping (
group_key) and image (image_url) support. - Exceptions:
NotInitializedException,DeviceRegistrationException,TopicSubscriptionException,NotificationManagementException.