$ show Finb/Bark
Bark is a native iOS application that turns APNs push notifications into a self-hostable, customizable notification delivery system. It is not a data or research project; it is a polished consumer iOS app with a companion widget, notification service extension, and App Intents. In production, the app maintains a device registration key per user, listens for remote notifications via Apple Push Notification service, and enriches incoming payloads through a chain of processors in the Notification Service Extension: decrypting AES-encrypted bodies (CBC/ECB/GCM with CryptoSwift), rendering Markdown, setting badges, auto-copying text, archiving to Realm, muting groups, triggering call interruptions, and attaching images/icons. The main app provides a history list with group/section rendering, server management (defaults to api.day.app but supports custom self-hosted servers), QR-code server import, encryption settings, archive retention controls, sound selection, and a modern home screen demonstrating usage via curl-like examples. A WidgetKit timeline widget shows recent messages from a shared JSON snapshot, and Siri/Shortcuts intents can trigger pushes to the current or another device. The architecture follows a reactive MVVM pattern using RxSwift/RxCocoa throughout, with Realm as the local persistence layer shared across app and extensions via an App Group container. The project targets iOS 15+ with five Xcode targets (main app, notification service extension, notification content extension, widget, tests) and is distributed via the App Store and TestFlight through fastlane and GitHub Actions.
The LLM identified 6 files worth highlighting for reuse:
Defines a protocol and ordered processor chain that mutates an incoming UNMutableNotificationContent. Each processor (Ciphertext, Markdown, Level, Badge, AutoCopy, Archive, Mute, Call, Image, Icon) handles one concern, making the pipeline easy to extend by inserting a new processor into the enum list. This is a clean, self-contained pattern for transforming push payloads in a notification service extension and could be extracted into any Apple platform project requiring modular notification enrichment.
Converts Markdown text into NSAttributedString with configurable fonts, colors, and link handling, likely built atop the swift-markdown package. It isolates presentation logic from the rest of the app, making it a reusable component for any iOS/macOS app that needs rich text rendering from Markdown without a heavyweight full-screen renderer.
Manages a compact JSON snapshot of recent push messages stored in the shared App Group container so the WidgetKit timeline can read history without waking the main app. It demonstrates a reliable cross-process data-sharing pattern between an iOS app and its widget/extension, including snapshot invalidation and reload triggers. This is directly reusable for any widget or extension that needs cheap read-only access to app state.
Downloads remote notification images with checks for existing cache entries, writes shared-cache keys, and coordinates with the main app's Kingfisher cache. It solves the recurring problem of downloading and displaying images in notification service extensions with memory/disk constraints, using App Group storage and cache coordination to avoid duplicate downloads across the app and extension.
Reactive view model backing the home screen: composes device key, server URL, push example commands, permission states, and donation/product info into observables for the view controller. It shows disciplined RxMVVM state wiring and demonstrates how to drive a complex settings/home screen without imperatively mutating UI state, making it a solid reference for RxSwift architecture in production iOS apps.
Typed Moya API client for the Bark push server: ping and register endpoints with per-server base URLs. It is small, decoupled from UI, and uses reactive single abstractions. The pattern is a clean example of a thin network layer that can be extracted for any small API client communicating with a custom server.