2016-04-13 06:59:28 +00:00
|
|
|
// A push notification server using Gin framework written in Go (Golang).
|
|
|
|
//
|
2016-04-13 07:22:04 +00:00
|
|
|
// Details about the gorush project are found in github page:
|
2016-04-13 06:59:28 +00:00
|
|
|
//
|
2022-12-19 08:43:05 +00:00
|
|
|
// https://github.com/appleboy/gorush
|
2016-04-13 06:59:28 +00:00
|
|
|
//
|
|
|
|
// The pre-compiled binaries can be downloaded from release page.
|
|
|
|
//
|
|
|
|
// Send Android notification
|
|
|
|
//
|
2022-12-19 08:43:05 +00:00
|
|
|
// $ gorush -android -m="your message" -k="API Key" -t="Device token"
|
2016-04-13 06:59:28 +00:00
|
|
|
//
|
|
|
|
// Send iOS notification
|
|
|
|
//
|
2022-12-19 08:43:05 +00:00
|
|
|
// $ gorush -ios -m="your message" -i="API Key" -t="Device token"
|
2016-04-13 06:59:28 +00:00
|
|
|
//
|
|
|
|
// The default endpoint is APNs development. Please add -production flag for APNs production push endpoint.
|
|
|
|
//
|
2022-12-19 08:43:05 +00:00
|
|
|
// $ gorush -ios -m="your message" -i="API Key" -t="Device token" -production
|
2016-04-13 06:59:28 +00:00
|
|
|
//
|
2016-04-17 05:20:26 +00:00
|
|
|
// Run gorush web server
|
|
|
|
//
|
2022-12-19 08:43:05 +00:00
|
|
|
// $ gorush -c config.yml
|
2016-04-17 05:20:26 +00:00
|
|
|
//
|
|
|
|
// Get go status of api server using httpie tool:
|
|
|
|
//
|
2022-12-19 08:43:05 +00:00
|
|
|
// $ http -v --verify=no --json GET https://localhost:8088/api/stat/go
|
2016-04-17 05:20:26 +00:00
|
|
|
//
|
|
|
|
// Simple send iOS notification example, the platform value is 1:
|
|
|
|
//
|
2022-12-19 08:43:05 +00:00
|
|
|
// {
|
|
|
|
// "notifications": [
|
|
|
|
// {
|
|
|
|
// "tokens": ["token_a", "token_b"],
|
|
|
|
// "platform": 1,
|
|
|
|
// "message": "Hello World iOS!"
|
|
|
|
// }
|
|
|
|
// ]
|
|
|
|
// }
|
2016-04-17 05:20:26 +00:00
|
|
|
//
|
|
|
|
// Simple send Android notification example, the platform value is 2:
|
|
|
|
//
|
2022-12-19 08:43:05 +00:00
|
|
|
// {
|
|
|
|
// "notifications": [
|
|
|
|
// {
|
|
|
|
// "tokens": ["token_a", "token_b"],
|
|
|
|
// "platform": 2,
|
|
|
|
// "message": "Hello World Android!"
|
|
|
|
// }
|
|
|
|
// ]
|
|
|
|
// }
|
2016-04-17 05:20:26 +00:00
|
|
|
//
|
2016-04-13 06:59:28 +00:00
|
|
|
// For more details, see the documentation and example.
|
2016-04-13 07:02:09 +00:00
|
|
|
package main
|