$ show binwiederhier/ntfy-ios
This repository contains the iOS client for the ntfy.sh notification service. It is a SwiftUI-based application that allows users to subscribe to topics for receiving push notifications, manage subscriptions, view notifications with attachments, and configure settings. The architecture follows a pattern similar to MVVM using ObservableObjects for state management, with Core Data for persistence and a Notification Service Extension for processing incoming notifications. Key features include Firebase Cloud Messaging integration, attachment handling (download, preview, share, save), critical alerts support, and background polling for notification synchronization. The app supports both the default ntfy.sh server and self-hosted instances.
The LLM identified 3 files worth highlighting for reuse:
A reusable networking layer that handles HTTP requests with automatic JSON encoding/decoding via the Actions utility. It manages authentication tokens, constructs API endpoints, and processes responses. The component is isolated (depends only on Actions and Config) and could be extracted for use in any Swift project requiring REST API communication with minimal changes to base URL and endpoint methods.
A self-contained utility providing static methods for safe JSON encoding and decoding, specifically handling optionals and empty arrays to match the ntfy API's expectations. It has no dependencies on other app-specific code and demonstrates a robust approach to API data transformation that could be reused in any project interacting with JSON-based web services.
Manages the bundled emojis.json asset, providing methods to search emojis by text, category, tags, and Unicode/iOS version. The component is isolated (only requires the JSON asset) and implements efficient filtering logic that could be adapted for any static dataset (e.g., symbols, icons, or reference data) with minimal modification to the data model.