Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![MSRV](https://img.shields.io/badge/MSRV-1.85-blue)](https://blog.rust-lang.org/2025/02/20/Rust-1.85.0/)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue)](https://github.com/LucaCappelletti94/pushups/blob/main/LICENSE)

Push notifications for Rust apps through each platform's own service, APNs on iOS and macOS, FCM or UnifiedPush on Android, WNS on Windows, UnifiedPush on Linux and Web Push in the browser. The app calls `install` in `main` before its toolkit starts, sets one handler and calls `register`. The handler gets the token for the app's server and every push, including the one that started the app.
Push notifications for Rust apps through each platform's own service, [APNs](https://developer.apple.com/documentation/usernotifications/registering-your-app-with-apns) on iOS and macOS, [FCM](https://firebase.google.com/docs/cloud-messaging) or [UnifiedPush](https://unifiedpush.org/) on Android, [WNS](https://learn.microsoft.com/en-us/windows/apps/develop/notifications/push-notifications/) on Windows, UnifiedPush on Linux and [Web Push](https://developer.mozilla.org/en-US/docs/Web/API/Push_API) in the browser. The app calls `install` in `main` before its toolkit starts, sets one handler and calls `register`. The handler gets the token for the app's server and every push, including the one that started the app.

```rust
use pushups::{Config, Event};
Expand All @@ -33,13 +33,24 @@ The handler runs on the platform's delivery thread, so waking the toolkit is its
| | Android | iOS | macOS | Windows | Linux | Web |
|---|---|---|---|---|---|---|
| Dioxus 0.7 | yes, though a tap into the running app restarts it until [tao#1365](https://github.com/tauri-apps/tao/pull/1365) | yes up to iOS 26, iOS 27 needs [dioxus#5893](https://github.com/DioxusLabs/dioxus/pull/5893) | yes | panics when its window cannot take focus, as on a locked screen, until Dioxus takes [wry#1799](https://github.com/tauri-apps/wry/pull/1799) | yes | yes |
| Tauri 2 | yes | yes | yes | yes | yes | n/a |
| Tauri 2 | yes | yes | yes | yes | yes | |
| winit 0.31 | needs [winit#4752](https://github.com/rust-windowing/winit/pull/4752), which `examples/winit` pins | yes | yes | yes | yes | yes |
| Leptos 0.8 | n/a | n/a | n/a | n/a | n/a | yes |
| Yew 0.23 | n/a | n/a | n/a | n/a | n/a | yes |
| Leptos 0.8 | | | | | | yes |
| Yew 0.23 | | | | | | yes |

Dioxus and Tauri run on tao, so their cells cover a tao app. Without the winit fix, a fresh install's first launch can get no FCM token until the app is reopened.

### Upstream fixes worth having

| PR | Why |
|---|---|
| [dioxus#5901](https://github.com/DioxusLabs/dioxus/pull/5901) | `dx` builds the iOS app icon from `Dioxus.toml`, the icon iOS shows on every notification |
| [dioxus#5898](https://github.com/DioxusLabs/dioxus/pull/5898) | `dx bundle --macos` fills each icon size from the closest PNG, so notifications show a sharp icon instead of one scaled from the first PNG listed |
| [dioxus#4063](https://github.com/DioxusLabs/dioxus/pull/4063), [dioxus#5693](https://github.com/DioxusLabs/dioxus/pull/5693) | `dx` sets the Android launcher icon, which FCM notifications use when the app names no notification icon |
| [dioxus#5591](https://github.com/DioxusLabs/dioxus/pull/5591) | `dx bundle` makes an IPA that Apple's validator accepts, the route from `dx` to the App Store |
| [dioxus#5900](https://github.com/DioxusLabs/dioxus/pull/5900) | `dx` renames its bundled JS when only this crate's JavaScript changes, so a web build stops serving the previous release's copy after an upgrade |
| [tao#1364](https://github.com/tauri-apps/tao/pull/1364) | tao reports the push token and pushes itself, so a tao app without this crate can receive them |

## Android

The crate's Gradle module holds the FCM and UnifiedPush services. `dx` bundles it through the `dioxus` feature, a Tauri app adds [`tauri-plugin-pushups`](https://github.com/LucaCappelletti94/pushups/tree/main/tauri-plugin-pushups), and any other Gradle project depends on `io.github.lucacappelletti94:pushups-android` at the crate's version or includes `android/` through `cargo metadata` as [`examples/winit`](https://github.com/LucaCappelletti94/pushups/tree/main/examples/winit) does. A `UnifiedPushConfig` sends pushes through the device's UnifiedPush distributor when it has one.
Expand Down
Loading