Notification Management
Background
Notifications are a high-touch feature. Unlike low-visibility background tasks such as model runs and training, notifications are more about user interactions. Each user has different frequency preferences.
Based on this, since v0.2.5 I separated notifications from the core logic to avoid over-notifying some users.
Now you can integrate notifications into your system with simple settings.
The flow has two main steps:
- Configure notification sources and targets
- Configure notification tasks
Notification source management

The following sources are supported:
This source requires configuration. Set host and port based on your email provider, and fill username and password with your email account credentials.
{
"host": "smtp.example.com",
"port": 587,
"username": "your_email@example.com",
"password": "your_password"
}Note: the password here is not your email password. It is the SMTP authorization code. See your email provider’s documentation for how to obtain it.
For example, in 163 Mail, you can get the SMTP authorization code by enabling SMTP. A popup will show a string, which is the SMTP authorization code. To use this source, you must enable SMTP.

Feishu
This source requires app_id and app_secret.
{
"app_id": "cli_a3f3d6a3a3f3d6a3a",
"app_secret": "dkamsklmlksamkl"
}Because Feishu does not allow direct linking to external files and images in notifications, you need to configure a bot with permission to upload files/images to Feishu. Steps:
- Go to the Feishu Developer Console and create a custom enterprise app. After creation, open the app details page and copy the app id and app secret into the configuration.

- Enable image upload permissions for the app.

DingTalk
No configuration is required for this source for now.
Apple APNS
This source is more complex. See the Apple developer docs: https://developer.apple.com/documentation/usernotifications/sending-notification-requests-to-apns
{
"team_id": "your team_id"
}- Go to the Apple Developer site and log in to your Apple developer account.
- In
Membership details, you can find yourTeam ID. - Go to the
Certificates, Identifiers & Profilespage, create a Key, and set parameters. Enable APNS and set the environment (Production/Sandbox).
- On the Key details page you can see the
Key ID.
- Click Download to get the Key file. The file content is the
Private Key. apns_topicis theBundle IDof your app.
Apple APNS (SandBox)
Same as above, but make sure your Key is for the sandbox environment.
Telegram
This source requires configuration:
{
"bot_token": "your_bot_token"
}- Open Telegram and search for
@BotFatherto find the bot creation assistant.
- Click Start (skip if already done).
- Enter
/newbot.
- Follow the prompts to set the bot’s name.

- Follow the prompts to set the bot’s id. The id must be globally unique in Telegram and end with
bot.
- After creation,
BotFatherwill return a message with the bot token. Copy it into the configuration.
Notification target management

The following targets are supported:
This target requires configuration:
{
"email": "your_email@example.com"
}email is the address you want to send notifications to.
Feishu
This target requires configuration:
{
"webhook_url": "https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxxxxxxxxxxxxxxx",
"sign": "xxxxxxxxx"
}- Create a custom webhook bot in a group.

- Open the bot configuration details and enable signature.

- Copy
Webhook URLandsignatureinto the configuration.
DingTalk
Same as Feishu above.
Apple APNS
{
"device_token": "your_device_token"
}To obtain it, configure your app code as follows:
class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate {
var window: UIWindow?
func application(_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
registerForRemoteNotifications()
UNUserNotificationCenter.current().delegate = self
return true
}
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
// If registration succeeds, this function is called
// Store in UserDefaults
UserDefaults(suiteName: "group.com.qingyon.Revornix")!.set(deviceToken.hexString, forKey: "device_token")
print("deviceToken:", deviceToken.hexString)
}
func application(_ application: UIApplication, didFailToRegisterForRemoteNotificationsWithError error: Error) {
print("Failed to register for remote notifications: \(error)")
}
...
}Apple APNS (SandBox)
Same as above.
Telegram
This target requires configuration:
{
"chat_id": "your_chat_id"
}- Create a Telegram group.
- Invite your Telegram bot to the group.
- Send a message starting with
/in the group. - Open
https://api.telegram.org/bot[your bot_token]/getUpdates(replace[your bot_token]with your token) and search for the message you just sent. - Find the id in the response, copy it, and fill it in the configuration.

Notification task management
Note: notification sources and targets must match, otherwise notifications cannot be sent. See the table below.
| Notification Source | Notification Target |
|---|---|
| Feishu | Feishu |
| DingTalk | DingTalk |
| Apple APNS | Apple APNS |
| Apple APNS (SandBox) | Apple APNS (SandBox) |
| Telegram | Telegram |

Both time triggers and event triggers are supported. Choose according to your needs.
Currently supported events:
- RemovedFromSection: you were removed from a section
- SectionCommented: a section you created or participated in was commented
- SectionSubscribed: a section you created or participated in was subscribed
- SectionUpdated: a section you participated in or subscribed to was updated
Custom notification content and template content are both supported. If you need real-time messages, you must choose template content because custom content is fixed when you configure it and cannot be updated dynamically.
Available templates:
- Daily Summary Template
- Removed From Section Template
- Section Commented Template
- Section Subscribed Template
- Section Updated Template