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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user