1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-26 22:30:35 +02:00

Support for Firebase ~poll keepalive topic that wakes up iOS devices every 20 minutes

This commit is contained in:
Philipp Heckel 2022-05-25 21:39:46 -04:00
parent 98b56c2f06
commit af76a2606d
4 changed files with 33 additions and 2 deletions
server

View file

@ -13,7 +13,8 @@ const (
DefaultAtSenderInterval = 10 * time.Second
DefaultMinDelay = 10 * time.Second
DefaultMaxDelay = 3 * 24 * time.Hour
DefaultFirebaseKeepaliveInterval = 3 * time.Hour // Not too frequently to save battery
DefaultFirebaseKeepaliveInterval = 3 * time.Hour // ~control topic (Android), not too frequently to save battery
DefaultFirebasePollInterval = 20 * time.Minute // ~poll topic (iOS), max. 2-3 times per hour (see docs)
)
// Defines all global and per-visitor limits
@ -67,6 +68,7 @@ type Config struct {
WebRootIsApp bool
AtSenderInterval time.Duration
FirebaseKeepaliveInterval time.Duration
FirebasePollInterval time.Duration
SMTPSenderAddr string
SMTPSenderUser string
SMTPSenderPass string
@ -117,6 +119,7 @@ func NewConfig() *Config {
MaxDelay: DefaultMaxDelay,
AtSenderInterval: DefaultAtSenderInterval,
FirebaseKeepaliveInterval: DefaultFirebaseKeepaliveInterval,
FirebasePollInterval: DefaultFirebasePollInterval,
TotalTopicLimit: DefaultTotalTopicLimit,
VisitorSubscriptionLimit: DefaultVisitorSubscriptionLimit,
VisitorAttachmentTotalSizeLimit: DefaultVisitorAttachmentTotalSizeLimit,