From 9104131c6fcb305dd8fa8567ac07434cc36ffe7e Mon Sep 17 00:00:00 2001 From: SinTod Date: Mon, 7 Feb 2022 19:01:51 +0800 Subject: [PATCH] modify README.md --- push/gorush-with-mipush/src/README.md | 49 +++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/push/gorush-with-mipush/src/README.md b/push/gorush-with-mipush/src/README.md index 67ff161..d8dcc61 100644 --- a/push/gorush-with-mipush/src/README.md +++ b/push/gorush-with-mipush/src/README.md @@ -1331,3 +1331,52 @@ Or you can deploy gorush to alternative solution like [netlify functions](https: Copyright 2019 Bo-Yi Wu [@appleboy](https://twitter.com/appleboy). Licensed under the MIT License. + +## gorush with MIPUSH + +### RUN + +```bash +./gorush -c ./config/testdata/config.yml + +``` + +```yaml +#add section +mi: + enabled: true + appsecret: "xxxxxxx" + package: "xxxxxxx" + max_retry: 3 # resend fail notification, default value zero is disabled +``` + +### API case + +```bash +# 单推 or 群推 +curl --location --request POST '127.0.0.1:8088/api/push' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "notifications": [ + { + "tokens": ["ufnjAD7ON0VfYUgZYNeFVId7Q9KXyGYIA2GrOTnE6JLlTmn+c7wR147AYJXcY7rv"], + "platform": 4, + "title":"Hello World MIPUSH!", + "message": "Hello World MIPUSH!" + } + ] +}' +# 全推 +curl --location --request POST '127.0.0.1:8088/api/push' \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "notifications": [ + { + "tokens": [], + "platform": 4, + "title":"Hello World MIPUSH!", + "message": "Hello World MIPUSH!" + } + ] +}' +```