day-part-push
Receive push notifications in Day apps. Request permission, register a device, observe token changes, and handle messages and notification taps. Your server sends through APNs or FCM.
Add to your app
Build with the Day CLI to include native sources and permissions. Configure the app's Apple capabilities or Firebase client resources using the setup guide. Sender keys belong on your server.
| Feature | Provider | Availability |
|---|---|---|
ios-apns (default) |
Apple Push Notification service | iOS / UIKit |
android-fcm (default) |
Firebase Cloud Messaging | Android / Material with Google Play services |
relay |
Client for the demo relay | Optional; requires a configured relay |
Desktop, web, and HarmonyOS do not have native push providers in this package.
Listen for notifications
Subscribe before registering and keep the returned watch alive:
use ;
async
Callbacks can run off the UI thread. Registration completes through events; a successful send response does not establish delivery to the device.
Android without Google dependencies
Disable default features and enable only the providers your app needs:
[]
= { = "0.*", = false, = ["ios-apns"] }
This configuration excludes FCM and Google Mobile Services from Android builds. It leaves Android
push unsupported until another provider is added. Cargo features are additive, so check the final
APK as well as the dependency graph. The demo includes fcm and fdroid build flavors.
Documentation and examples
- Permissions, token lifecycle, and platform setup
- Run Push Lab
- Run the Cloudflare demo relay
- CI, crate reservation, and trusted publishing