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

@@ -22,14 +22,14 @@ var (
// NotificationService handles notification business logic
type NotificationService struct {
notificationRepo *repositories.NotificationRepository
gorushClient *push.GorushClient
pushClient *push.Client
}
// NewNotificationService creates a new notification service
func NewNotificationService(notificationRepo *repositories.NotificationRepository, gorushClient *push.GorushClient) *NotificationService {
func NewNotificationService(notificationRepo *repositories.NotificationRepository, pushClient *push.Client) *NotificationService {
return &NotificationService{
notificationRepo: notificationRepo,
gorushClient: gorushClient,
pushClient: pushClient,
}
}
@@ -123,8 +123,8 @@ func (s *NotificationService) CreateAndSendNotification(ctx context.Context, use
pushData["notification_id"] = string(rune(notification.ID))
// Send push notification
if s.gorushClient != nil {
err = s.gorushClient.SendToAll(ctx, iosTokens, androidTokens, title, body, pushData)
if s.pushClient != nil {
err = s.pushClient.SendToAll(ctx, iosTokens, androidTokens, title, body, pushData)
if err != nil {
s.notificationRepo.SetError(notification.ID, err.Error())
return err