Fix notification sounds under iOS
This commit is contained in:
@@ -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{
|
||||||
|
|||||||
Reference in New Issue
Block a user