Merge pull request #68 from appleboy/topic
Fixed #67 Support iOS apns-topic flag.
This commit is contained in:
commit
f6bed08497
2
Makefile
2
Makefile
|
@ -1,7 +1,5 @@
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
|
|
||||||
VERSION=0.0.1
|
|
||||||
|
|
||||||
DEPS := $(wildcard *.go)
|
DEPS := $(wildcard *.go)
|
||||||
BUILD_IMAGE := "gorush-build"
|
BUILD_IMAGE := "gorush-build"
|
||||||
TEST_IMAGE := "gorush-testing"
|
TEST_IMAGE := "gorush-testing"
|
||||||
|
|
|
@ -95,12 +95,13 @@ $ gorush -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
|
||||||
$ gorush -ios -m="your message" -i="your certificate path" -t="device token"
|
$ gorush -ios -m="your message" -i="your certificate path" -t="device token" -topic="apns topic"
|
||||||
```
|
```
|
||||||
|
|
||||||
* `-m`: Notification message.
|
* `-m`: Notification message.
|
||||||
* `-i`: Apple Push Notification Certificate path (`pem` file).
|
* `-i`: Apple Push Notification Certificate path (`pem` file).
|
||||||
* `-t`: Device token.
|
* `-t`: Device token.
|
||||||
|
* `-topic`: The topic of the remote notification.
|
||||||
|
|
||||||
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.
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ func main() {
|
||||||
android := flag.Bool("android", false, "send android notification")
|
android := flag.Bool("android", false, "send android notification")
|
||||||
ios := flag.Bool("ios", false, "send ios notification")
|
ios := flag.Bool("ios", false, "send ios notification")
|
||||||
production := flag.Bool("production", false, "production mode in iOS")
|
production := flag.Bool("production", false, "production mode in iOS")
|
||||||
|
topic := flag.String("topic", "", "apns topic in iOS")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
@ -104,6 +105,10 @@ func main() {
|
||||||
Message: *message,
|
Message: *message,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if *topic != "" {
|
||||||
|
req.Topic = *topic
|
||||||
|
}
|
||||||
|
|
||||||
err := gorush.CheckMessage(req)
|
err := gorush.CheckMessage(req)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue