set ios and android as disabled mode.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
parent
2e0673a32d
commit
59beeb7183
3
Makefile
3
Makefile
|
@ -18,9 +18,8 @@ docker_build: clean
|
|||
tar -zcvf build.tar.gz gopush.go gopush
|
||||
docker build -t $(BUILD_IMAGE) -f docker/Dockerfile.build .
|
||||
docker run $(BUILD_IMAGE) > bin.tar.gz
|
||||
-rm -rf build.tar.gz
|
||||
tar -zxvf bin.tar.gz
|
||||
-rm -rf bin.tar.gz
|
||||
-rm -rf bin.tar.gz build.tar.gz
|
||||
|
||||
clean:
|
||||
rm -rf build.tar.gz bin.tar.gz bin/*
|
||||
|
|
|
@ -36,6 +36,12 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
if !gopush.PushConf.Ios.Enabled && !gopush.PushConf.Android.Enabled {
|
||||
log.Printf("Note: Please enable iOS or Android config in yaml config")
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if gopush.PushConf.Ios.Enabled {
|
||||
|
||||
if *certificateKeyPath != "" {
|
||||
|
|
|
@ -48,10 +48,10 @@ func BuildDefaultPushConf() ConfYaml {
|
|||
|
||||
// Android
|
||||
conf.Android.ApiKey = ""
|
||||
conf.Android.Enabled = true
|
||||
conf.Android.Enabled = false
|
||||
|
||||
// iOS
|
||||
conf.Ios.Enabled = true
|
||||
conf.Ios.Enabled = false
|
||||
conf.Ios.PemCertPath = "cert.pem"
|
||||
conf.Ios.PemKeyPath = "key.pem"
|
||||
conf.Ios.Production = false
|
||||
|
|
|
@ -86,8 +86,14 @@ func pushNotification(notification RequestPushNotification) bool {
|
|||
|
||||
switch notification.Platform {
|
||||
case PlatFormIos:
|
||||
if !PushConf.Ios.Enabled {
|
||||
return false
|
||||
}
|
||||
success = pushNotificationIos(notification)
|
||||
case PlatFormAndroid:
|
||||
if !PushConf.Android.Enabled {
|
||||
return false
|
||||
}
|
||||
success = pushNotificationAndroid(notification)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue