notiblast_sdk 0.9.0 copy "notiblast_sdk: ^0.9.0" to clipboard
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: setReplyHandler gets dismissOnReply, 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: NotiBlastCommunication gets initialsFallback (default true). Set it to false to skip the initials avatar when avatarURL is nil or 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: homepage points to notiblast.com; added repository.

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 optional NotiBlastConversation.conversationAvatarUrl sets the avatar, padded so the round mask doesn't cut its edges; without it, defaultAvatarDrawable or an initials avatar (first letters of the first two words of the new optional avatarName, 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 a NotiBlastCommunication; the default nil keeps the current look. Needs the Communication Notifications capability and two Info.plist entries — see "Chat notifications on iOS" in the README. Without an avatar the SDK draws an initials avatar from the new optional NotiBlastCommunication.avatarName, else the group or sender name. In the foreground iOS shows these pushes itself and showNotification() skips them (marked data['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. The NotiBlastNSE pod now also links Intents and CryptoKit and has new files — run pod 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_url in 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:core dependency 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. NotiBlastNotificationService converts 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). The NotiBlastNSE pod now also links ImageIO — run pod 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 with BadDeviceToken until the app was opened. login() and reply delivery are not delayed.

  • Added NotiBlast.setLogHandler(): receive every SDK log line as a NotiBlastLogRecord (level, module, message, error, stack trace), so SDK logs are visible in Release / TestFlight builds. Can be set before initAppId(). 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 a NotiBlastReplyEvent with the typed text and the notification (including its full data). Pass a canReply function to decide which notifications can be replied to (any rule you like, e.g. group_key starting with groupChat-), and actionTitle / placeholder / sendButtonTitle to 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() in AppDelegate's didFinishLaunchingWithOptions so replies work while the app is closed. Override the new canReply(groupKey:data:) on NotiBlastNotificationService (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-level toConversation function decides which notifications become conversations and returns a NotiBlastConversation (sender, text, title, avatar); everything else is shown as before. Style it with NotiBlastConversationStyle (max messages, your own name and avatar, avatars on/off, fallback avatar drawable, group summary, round or square avatars via NotiBlastAvatarShape), globally or per conversation. Downloaded avatars are resized to 192×192 and cropped round by default. Successful replies are added to the conversation. Also added clearConversationHandler() and clearConversation(conversationId).

  • Conversation notifications (Android) show the push image_url inside the message bubble, and older messages keep their image when the conversation updates. No API change: the SDK's manifest declares its own FileProvider (<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 timeoutAfter to NotiBlastNotification.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 its groupId but 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. Call setReplyHandler() / setConversationHandler() after initAppId() on every app start.

0.6.0 #

  • Breaking Removed NotiBlast.Notifications.setBackgroundHandler() and NotiBlastNotification.fromBackgroundMessage(). Notifications that arrive while the app is in the background or terminated are always shown by the SDK. Delete your background handler and the setBackgroundHandler() call; to keep a notification from reaching a user, filter it on the backend.
  • Breaking NotiBlastNotification.showNotification() no longer takes android and ios arguments — call it without arguments. Notifications always use the SDK's display settings, so the payload's group_key and image_url are always applied.
  • Breaking package:notiblast_sdk no longer re-exports RemoteMessage or the flutter_local_notifications display types (AndroidNotificationDetails, DarwinNotificationDetails, and the types their fields take). If your app uses them for its own purposes, depend on firebase_messaging / flutter_local_notifications directly.

0.5.0 #

  • Breaking Removed NotiBlastNotification.isGroupSummary and its constructor parameter. The SDK no longer reads the is_group_summary payload field (it is still available in data). To check whether a notification is grouped, use notification.groupId != null.
  • Changed On Android, a notification with a group_key is now posted as a group child, and the SDK posts one summary per group_key with GroupAlertBehavior.children, so grouped notifications stack in the tray and only the new one alerts. No summary is posted on iOS or when you pass custom android details to showNotification().
  • 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. Subclass NotiBlastNotificationService in your extension target (one line) and iOS alert pushes get the title/body from the payload, grouping from group_key, and the image from image_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 addForegroundListener and only appears if you call showNotification() — the same as Android. Before login() 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 notification block (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 new NotiBlastNotification.fromBackgroundMessage() and call showNotification() 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 RemoteMessage is re-exported from package:notiblast_sdk, so typing a background handler needs no direct dependency on firebase_messaging.
  • Added showNotification() takes optional android and ios arguments (AndroidNotificationDetails / DarwinNotificationDetails) to replace the SDK's default display settings for that platform. A custom value is used as-is, so the payload's group_key, is_group_summary, and image_url are 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 from package:notiblast_sdk, so passing custom settings needs no direct dependency on flutter_local_notifications.
  • Fixed On iOS, tapping a notification that arrived while the app was in the background did nothing — addClickListener never 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.data now 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 a Map/List; plain strings and invalid JSON are kept as-is. Typed getters (title, body, ...) still read the original string. Apps that jsonDecode these 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() and removeRegistrationErrorListener() — stop receiving events on a listener registered earlier, e.g. from a widget's dispose(). 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.Notifications can now be accessed before NotiBlast.initAppId() without throwing, so listeners can be registered as early as you like. Methods that need Firebase still require initAppId() 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.
0
likes
160
points
95
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter push-notification SDK for the NotiBlast backend: FCM device registration, tray display, inline reply, and chat-style conversation notifications.

Homepage
Repository (GitLab)

License

MIT (license)

Dependencies

device_info_plus, firebase_core, firebase_messaging, flutter, flutter_local_notifications, http, meta, package_info_plus, shared_preferences

More

Packages that depend on notiblast_sdk

Packages that implement notiblast_sdk