diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 30172ca..33721c5 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,10 +4,10 @@
-
+
-
+
@@ -142,7 +142,6 @@
-
@@ -167,7 +166,8 @@
-
+
+
true
diff --git a/pkg/services/notifications.go b/pkg/services/notifications.go
index ddfdd3e..2974ad7 100644
--- a/pkg/services/notifications.go
+++ b/pkg/services/notifications.go
@@ -8,6 +8,7 @@ import (
"github.com/rs/zerolog/log"
"github.com/sideshow/apns2"
payload2 "github.com/sideshow/apns2/payload"
+ "github.com/spf13/viper"
"reflect"
)
@@ -112,13 +113,15 @@ func PushNotification(notification models.Notification) error {
NewPayload().
AlertTitle(notification.Subject).
AlertBody(notification.Content).
+ Badge(1).
MarshalJSON()
if err != nil {
log.Warn().Err(err).Msg("An error occurred when preparing to notify subscriber via APNs...")
}
payload := &apns2.Notification{
+ ApnsID: subscriber.DeviceID,
DeviceToken: subscriber.DeviceToken,
- Topic: "dev.solsynth.solian",
+ Topic: viper.GetString("apns_topic"),
Payload: data,
}
diff --git a/settings.toml b/settings.toml
index 263d49b..b72b3bf 100644
--- a/settings.toml
+++ b/settings.toml
@@ -6,6 +6,7 @@ grpc_bind = "0.0.0.0:7444"
domain = "localhost"
secret = "LtTjzAGFLshwXhN4ZD4nG5KlMv1MWcsvfv03TSZYnT1VhiAnLIZFTnHUwR0XhGgi"
+apns_topic = "dev.solsynth.solian.Runner"
apns_credentials = ""
apns_credentials_team = "000000000"
apns_credentials_key = "000000000"