remove log message.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
a568ed98c7
commit
f9d5b91b6c
|
@ -49,12 +49,14 @@ log:
|
||||||
|
|
||||||
How to send push notification using `gopush` command? (Android or iOS)
|
How to send push notification using `gopush` command? (Android or iOS)
|
||||||
|
|
||||||
|
Download `gopush` binary file from [release page](https://github.com/appleboy/gopush/releases).
|
||||||
|
|
||||||
### Android
|
### Android
|
||||||
|
|
||||||
Send single notification with the following command.
|
Send single notification with the following command.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ./gopush -android -m="your message" -k="API Key" -t="Device token"
|
$ gopush -android -m="your message" -k="API Key" -t="Device token"
|
||||||
```
|
```
|
||||||
|
|
||||||
* `-m`: Notification message.
|
* `-m`: Notification message.
|
||||||
|
@ -66,7 +68,7 @@ $ ./gopush -android -m="your message" -k="API Key" -t="Device token"
|
||||||
Send single notification with the following command.
|
Send single notification with the following command.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ./gopush -ios -m="your message" -i="API Key" -t="Device token"
|
$ gopush -ios -m="your message" -i="API Key" -t="Device token"
|
||||||
```
|
```
|
||||||
|
|
||||||
* `-m`: Notification message.
|
* `-m`: Notification message.
|
||||||
|
@ -76,7 +78,7 @@ $ ./gopush -ios -m="your message" -i="API Key" -t="Device token"
|
||||||
The default endpoint is APNs development. Please add `-production` flag for APNs production push endpoint.
|
The default endpoint is APNs development. Please add `-production` flag for APNs production push endpoint.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ ./gopush -ios -m="your message" -i="API Key" -t="Device token" -production
|
$ gopush -ios -m="your message" -i="API Key" -t="Device token" -production
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
|
@ -35,7 +35,7 @@ func main() {
|
||||||
gopush.PushConf, err = gopush.LoadConfYaml(*confPath)
|
gopush.PushConf, err = gopush.LoadConfYaml(*confPath)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Unable to load yaml config file: '%v'", err)
|
log.Printf("Load yaml config file error: '%v'", err)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package gopush
|
||||||
import (
|
import (
|
||||||
"gopkg.in/yaml.v2"
|
"gopkg.in/yaml.v2"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ConfYaml struct {
|
type ConfYaml struct {
|
||||||
|
@ -89,16 +88,12 @@ func LoadConfYaml(confPath string) (ConfYaml, error) {
|
||||||
configFile, err := ioutil.ReadFile(confPath)
|
configFile, err := ioutil.ReadFile(confPath)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Unable to read config file, path: '%s'", confPath)
|
|
||||||
|
|
||||||
return config, err
|
return config, err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = yaml.Unmarshal([]byte(configFile), &config)
|
err = yaml.Unmarshal([]byte(configFile), &config)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Unable to Unmarshal config file '%s'", confPath)
|
|
||||||
|
|
||||||
return config, err
|
return config, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue