From 479ec7fa5cd0b2e755166bed1bb16326fbfa173b Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 28 Apr 2016 14:39:34 +0800 Subject: [PATCH 1/2] Fixed #67 Support iOS apns-topic flag. Signed-off-by: Bo-Yi Wu --- gorush.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gorush.go b/gorush.go index 7e48168..afc28df 100644 --- a/gorush.go +++ b/gorush.go @@ -27,6 +27,7 @@ func main() { android := flag.Bool("android", false, "send android notification") ios := flag.Bool("ios", false, "send ios notification") production := flag.Bool("production", false, "production mode in iOS") + topic := flag.String("topic", "", "apns topic in iOS") flag.Parse() @@ -104,6 +105,10 @@ func main() { Message: *message, } + if *topic != "" { + req.Topic = *topic + } + err := gorush.CheckMessage(req) if err != nil { From 458254b8e0272afc0e1b019e50a49aa2640a2157 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 28 Apr 2016 14:45:25 +0800 Subject: [PATCH 2/2] update readme for topic flag. Signed-off-by: Bo-Yi Wu --- Makefile | 2 -- README.md | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 32eeff4..d8a4a67 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,5 @@ .PHONY: all -VERSION=0.0.1 - DEPS := $(wildcard *.go) BUILD_IMAGE := "gorush-build" TEST_IMAGE := "gorush-testing" diff --git a/README.md b/README.md index e817ae9..a9abdbc 100644 --- a/README.md +++ b/README.md @@ -95,12 +95,13 @@ $ gorush -android -m="your message" -k="API Key" -t="Device token" Send single notification with the following command. ```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. * `-i`: Apple Push Notification Certificate path (`pem` file). * `-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.