Replace Gorush with direct APNs/FCM integration

- Add direct APNs client using sideshow/apns2 for iOS push
- Add direct FCM client using legacy HTTP API for Android push
- Remove Gorush dependency (no external push server needed)
- Update all services/handlers to use new push.Client
- Update config for APNS_PRODUCTION flag

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Trey t
2025-11-29 12:04:31 -06:00
parent c4118c8186
commit a15e847098
15 changed files with 649 additions and 257 deletions

View File

@@ -39,11 +39,16 @@ func main() {
sqlDB, _ := db.DB()
defer sqlDB.Close()
// Initialize push client (optional)
var gorushClient *push.GorushClient
if cfg.Push.GorushURL != "" {
gorushClient = push.NewGorushClient(&cfg.Push)
log.Info().Str("url", cfg.Push.GorushURL).Msg("Gorush client initialized")
// Initialize push client (APNs + FCM)
var pushClient *push.Client
pushClient, err = push.NewClient(&cfg.Push)
if err != nil {
log.Warn().Err(err).Msg("Failed to initialize push client - push notifications disabled")
} else {
log.Info().
Bool("ios_enabled", pushClient.IsIOSEnabled()).
Bool("android_enabled", pushClient.IsAndroidEnabled()).
Msg("Push notification client initialized")
}
// Initialize email service (optional)
@@ -80,7 +85,7 @@ func main() {
)
// Create job handler
jobHandler := jobs.NewHandler(db, gorushClient, emailService, cfg)
jobHandler := jobs.NewHandler(db, pushClient, emailService, cfg)
// Create Asynq mux and register handlers
mux := asynq.NewServeMux()