Skip to content

Repository files navigation

Feather Push

An abstract push notification client for Feather CMS.

Release: 1.0.0-beta.2

Features

  • Topic- and device-token-based push notification delivery
  • Silent and normal delivery modes
  • Deep-link and rich notification metadata
  • Badge, sound, and notification collapsing support
  • Provider-neutral client and error APIs

Requirements

Swift 6.1+ Platforms: Linux, macOS, iOS, tvOS, watchOS, visionOS

  • Swift 6.1+
  • Platforms:
    • Linux
    • macOS 15+
    • iOS 18+
    • tvOS 18+
    • watchOS 11+
    • visionOS 2+

Installation

Use Swift Package Manager; add the dependency to your Package.swift file:

.package(url: "https://github.com/feather-framework/feather-push", exact: "1.0.0-beta.2"),

Then add FeatherPush to your target dependencies:

.product(name: "FeatherPush", package: "feather-push"),

Usage

DocC API documentation

API documentation is available at the following link.

PushClient accepts a single delivery target for every notification.

Providers do not all support the same targeting model. For example, FCM supports subscribable topics, while APNs delivers to device tokens and uses its topic value to identify the application rather than a group of subscribers. An implementation that cannot handle a target should throw PushClientError.unsupportedTarget.

let notification = PushNotification(
    title: "New message",
    body: "You have a new message.",
    data: ["messageID": "123"],
    deepLink: "myapp://messages/123",
    badge: 1,
    sound: .default
)

// Device-token delivery is supported by every PushClient implementation.
func sendDeviceNotification(using client: some PushClient) async throws {
    try await client.send(
        notification: notification,
        to: .deviceToken("device-registration-token")
    )
}

The same interface can target a provider-managed topic:

func sendTopicNotification(using client: some PushClient) async throws {
    try await client.send(
        notification: notification,
        to: .topic("messages")
    )
}

Warning

This repository is a work in progress, things can break until it reaches v1.0.0.

Push implementations

The following push client implementations are available for use:

Development

  • Build: swift build
  • Test:
    • local: make test
    • using Docker: make docker-test
  • Format: make format
  • Check: make check

Contributing

Pull requests are welcome. Please keep changes focused and include tests for new logic.

About

An abstract push client for Feather CMS

Topics

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Used by

Contributors

Languages