inflow
Warning: This project is in a very early stage and is not functional yet. APIs will change without notice.
Matrix push notification gateway types, preferences, and pusher registration library.
inflow provides the shared data types and logic used by Matrix chat clients to configure and register push notification gateways with a Matrix homeserver. It is designed for use by multiple front-end projects (e.g. Synpad, Robrix) that need a common push notification layer.
Gateway Support
| Gateway | Description |
|---|---|
| Sygnal | Standard Matrix push gateway using FCM (Android) and APNs (iOS). Works globally. |
| Bugle | Push gateway with domestic Chinese Android OEM provider support. Routes through JPush third_party_channel to Huawei Push Kit, Xiaomi Mi Push, OPPO Push, vivo Push, HONOR Push, and HarmonyOS. Ideal for mainland China where Google FCM is unavailable. |
| Custom | User-provided gateway URL for self-hosted or third-party gateways. |
Features
| Feature | Description |
|---|---|
| (default) | Core types (PushGatewayType, PushPreferences) and JSON serialization helpers. No network dependencies. |
matrix |
Adds register_pusher() and unregister_pusher() functions that use matrix_sdk::Client to register/unregister HTTP pushers with a Matrix homeserver. |
Quick Start
Add to your Cargo.toml:
[]
= { = "../inflow" }
# or with pusher registration:
# inflow = { path = "../inflow", features = ["matrix"] }
Core types (no network)
use ;
// Create preferences with Bugle gateway for China users
let mut prefs = PushPreferences ;
prefs.apply_gateway_type_defaults;
// Resolve the correct app ID for the gateway
let app_id = prefs.android_app_id;
assert_eq!;
// Serialize to JSON for persistence
let json = to_json.unwrap;
let loaded = from_json;
assert_eq!;
Pusher registration (requires matrix feature)
use ;
let config = PusherConfig ;
let prefs = default;
register_pusher.await?;
Architecture
Matrix Client (Synpad / Robrix / ...)
|
v
┌─────────┐ PushPreferences
│ inflow │───> PushGatewayType { Sygnal, Bugle, Custom }
└────┬─────┘ register_pusher() / unregister_pusher()
|
v
Matrix Homeserver
|
v
Push Gateway (Sygnal or Bugle)
|
├── FCM ──> Android (global)
├── APNs ─> iOS
└── Bugle domestic providers:
├── JPush (aggregation layer)
├── Huawei Push Kit / HarmonyOS
├── Xiaomi Mi Push
├── OPPO / OnePlus Push
├── vivo Push
└── HONOR Push
License
Licensed under Apache 2.0. See LICENSE.