Update push notification usage
This commit is contained in:
parent
771a222787
commit
e8c2a6ff75
@ -55,7 +55,7 @@ func testPackage(pkg string) {
|
|||||||
|
|
||||||
// Send notification to the admin
|
// Send notification to the admin
|
||||||
admin, _ := arn.GetUser("4J6qpK1ve")
|
admin, _ := arn.GetUser("4J6qpK1ve")
|
||||||
admin.SendNotification(&arn.Notification{
|
admin.SendNotification(&arn.PushNotification{
|
||||||
Title: pkg,
|
Title: pkg,
|
||||||
Message: "Test failed",
|
Message: "Test failed",
|
||||||
Link: "https://" + pkg,
|
Link: "https://" + pkg,
|
||||||
|
@ -16,13 +16,11 @@ func Test(ctx *aero.Context) string {
|
|||||||
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
|
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
notification := &arn.Notification{
|
user.SendNotification(&arn.PushNotification{
|
||||||
Title: "Anime Notifier",
|
Title: "Anime Notifier",
|
||||||
Message: "Yay, it works!",
|
Message: "Yay, it works!",
|
||||||
Icon: "https://" + ctx.App.Config.Domain + "/images/brand/220.png",
|
Icon: "https://" + ctx.App.Config.Domain + "/images/brand/220.png",
|
||||||
}
|
})
|
||||||
|
|
||||||
user.SendNotification(notification)
|
|
||||||
|
|
||||||
return "ok"
|
return "ok"
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ func Success(ctx *aero.Context) string {
|
|||||||
// Notify admin
|
// Notify admin
|
||||||
go func() {
|
go func() {
|
||||||
admin, _ := arn.GetUser(adminID)
|
admin, _ := arn.GetUser(adminID)
|
||||||
admin.SendNotification(&arn.Notification{
|
admin.SendNotification(&arn.PushNotification{
|
||||||
Title: user.Nick + " bought " + strconv.Itoa(payment.Gems()) + " gems",
|
Title: user.Nick + " bought " + strconv.Itoa(payment.Gems()) + " gems",
|
||||||
Message: user.Nick + " paid " + payment.Amount + " " + payment.Currency + " making his new balance " + strconv.Itoa(user.Balance),
|
Message: user.Nick + " paid " + payment.Amount + " " + payment.Currency + " making his new balance " + strconv.Itoa(user.Balance),
|
||||||
Icon: user.LargeAvatar(),
|
Icon: user.LargeAvatar(),
|
||||||
|
@ -200,9 +200,8 @@ class MyServiceWorker {
|
|||||||
return self.registration.showNotification(payload.title, {
|
return self.registration.showNotification(payload.title, {
|
||||||
body: payload.message,
|
body: payload.message,
|
||||||
icon: payload.icon,
|
icon: payload.icon,
|
||||||
image: payload.image,
|
|
||||||
data: payload.link,
|
data: payload.link,
|
||||||
badge: "https://notify.moe/brand/64.png"
|
badge: "https://media.notify.moe/images/brand/64.png"
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user