From dec96cd4296b628fd0db60fb3505cddd3adf5ff8 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Tue, 21 Jun 2022 11:27:39 +0800 Subject: [PATCH] jpush add config for ios env mode --- config/config.yaml | 1 + internal/push/jpush/push.go | 2 +- pkg/common/config/config.go | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/config.yaml b/config/config.yaml index 81d7f9627..58c08a8b1 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -233,6 +233,7 @@ messageverify: iospush: pushSound: "xxx" badgeCount: true + production: true callback: # callback url 需要自行更换callback url diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index aaaee306d..a1c957305 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -42,7 +42,7 @@ func (j *JPush) Push(accounts []string, alert, detailContent, operationID string var me requestBody.Message me.SetMsgContent(detailContent) var o requestBody.Options - o.SetApnsProduction(false) + o.SetApnsProduction(config.Config.IOSPush.Production) var po requestBody.PushObj po.SetPlatform(&pf) po.SetAudience(&au) diff --git a/pkg/common/config/config.go b/pkg/common/config/config.go index 875051c27..c376d13ff 100644 --- a/pkg/common/config/config.go +++ b/pkg/common/config/config.go @@ -208,6 +208,7 @@ type config struct { IOSPush struct { PushSound string `yaml:"pushSound"` BadgeCount bool `yaml:"badgeCount"` + Production bool `yaml:"production"` } Callback struct {