27 lines
513 B
Go
Raw Normal View History

2017-07-14 21:50:34 +00:00
package notifications
import (
"net/http"
"github.com/aerogo/aero"
2017-07-14 23:32:06 +00:00
"github.com/animenotifier/arn"
2017-07-14 21:50:34 +00:00
"github.com/animenotifier/notify.moe/utils"
)
// Test ...
func Test(ctx *aero.Context) string {
user := utils.GetUser(ctx)
if user == nil {
return ctx.Error(http.StatusBadRequest, "Not logged in", nil)
}
2018-02-27 12:29:47 +00:00
user.SendNotification(&arn.PushNotification{
2017-07-14 23:32:06 +00:00
Title: "Anime Notifier",
Message: "Yay, it works!",
2017-11-04 21:23:07 +00:00
Icon: "https://" + ctx.App.Config.Domain + "/images/brand/220.png",
2018-02-27 12:29:47 +00:00
})
2017-07-14 23:32:06 +00:00
2017-07-14 21:50:34 +00:00
return "ok"
}