Fix notification sounds under iOS
Some checks failed
Build Docker and Deploy / Build Docker Container (push) Successful in 1m38s
Build Docker and Deploy / Run Unit-Tests (push) Failing after 9m23s
Build Docker and Deploy / Deploy to Server (push) Has been skipped

This commit is contained in:
2025-12-18 15:02:51 +01:00
parent 54c4f873fc
commit 24bf7cd434

View File

@@ -1,22 +1,23 @@
package push package push
import ( import (
scn "blackforestbytes.com/simplecloudnotifier"
"blackforestbytes.com/simplecloudnotifier/models"
"bytes" "bytes"
"context" "context"
_ "embed" _ "embed"
"encoding/json" "encoding/json"
"errors" "errors"
"fmt" "fmt"
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
"github.com/gin-gonic/gin"
"github.com/rs/zerolog/log"
"io" "io"
"net/http" "net/http"
"strconv" "strconv"
"strings" "strings"
"time" "time"
scn "blackforestbytes.com/simplecloudnotifier"
"blackforestbytes.com/simplecloudnotifier/models"
"git.blackforestbytes.com/BlackForestBytes/goext/langext"
"github.com/gin-gonic/gin"
"github.com/rs/zerolog/log"
) )
// https://firebase.google.com/docs/cloud-messaging/send-message#rest // https://firebase.google.com/docs/cloud-messaging/send-message#rest
@@ -66,7 +67,13 @@ func (fb FirebaseConnector) SendNotification(ctx context.Context, user models.Us
"title": msg.Title, "title": msg.Title,
"body": msg.ShortContent(), "body": msg.ShortContent(),
}, },
"apns": gin.H{}, "apns": gin.H{
"payload": gin.H{
"aps": gin.H{
"sound": "default",
},
},
},
} }
} else if client.Type == models.ClientTypeAndroid { } else if client.Type == models.ClientTypeAndroid {
jsonBody = gin.H{ jsonBody = gin.H{