fix #2860 migrate jpns to jpush (#2861)

pull/2869/head
Wiky Lyu 1 month ago committed by GitHub
parent 8471a0ef3b
commit 1df49ee718
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -26,7 +26,7 @@ fcm:
# Prioritize using file paths. If the file path is empty, use URL
filePath: # File path is concatenated with the parameters passed in through - c(`mage` default pass in `config/`) and filePath.
authURL: # Must start with https or http.
jpns:
jpush:
appKey:
masterSecret:
pushURL:

@ -240,11 +240,11 @@ push:
channelName: ${GETUI_CHANNEL_NAME}
fcm:
serviceAccount: "${FCM_SERVICE_ACCOUNT}"
jpns:
appKey: ${JPNS_APP_KEY}
masterSecret: ${JPNS_MASTER_SECRET}
pushUrl: ${JPNS_PUSH_URL}
pushIntent: ${JPNS_PUSH_INTENT}
jpush:
appKey: ${JPUSH_APP_KEY}
masterSecret: ${JPUSH_MASTER_SECRET}
pushUrl: ${JPUSH_PUSH_URL}
pushIntent: ${JPUSH_PUSH_INTENT}
# App manager configuration
#

@ -474,10 +474,10 @@ This section involves setting up additional configuration variables for Websocke
| GETUI_CHANNEL_ID | [User Defined] | GeTui Channel ID |
| GETUI_CHANNEL_NAME | [User Defined] | GeTui Channel Name |
| FCM_SERVICE_ACCOUNT | "x.json" | FCM Service Account |
| JPNS_APP_KEY | [User Defined] | JPNS Application Key |
| JPNS_MASTER_SECRET | [User Defined] | JPNS Master Secret |
| JPNS_PUSH_URL | [User Defined] | JPNS Push Notification URL |
| JPNS_PUSH_INTENT | [User Defined] | JPNS Push Intent |
| JPUSH_APP_KEY | [User Defined] | JPUSH Application Key |
| JPUSH_MASTER_SECRET | [User Defined] | JPUSH Master Secret |
| JPUSH_PUSH_URL | [User Defined] | JPUSH Push Notification URL |
| JPUSH_PUSH_INTENT | [User Defined] | JPUSH Push Intent |
| IM_ADMIN_USERID | "imAdmin" | IM Administrator ID |
| IM_ADMIN_NAME | "imAdmin" | IM Administrator Nickname |
| MULTILOGIN_POLICY | "1" | Multi-login Policy |

@ -64,7 +64,7 @@ func (n *Notification) SetExtras(extras map[string]string) {
}
func (n *Notification) SetAndroidIntent(pushConf *config.Push) {
n.Android.Intent.URL = pushConf.JPNS.PushIntent
n.Android.Intent.URL = pushConf.JPush.PushIntent
}
func (n *Notification) IOSEnableMutableContent() {

@ -89,9 +89,9 @@ func (j *JPush) Push(ctx context.Context, userIDs []string, title, content strin
func (j *JPush) request(ctx context.Context, po body.PushObj, resp *map[string]any, timeout int) error {
err := j.httpClient.PostReturn(
ctx,
j.pushConf.JPNS.PushURL,
j.pushConf.JPush.PushURL,
map[string]string{
"Authorization": j.getAuthorization(j.pushConf.JPNS.AppKey, j.pushConf.JPNS.MasterSecret),
"Authorization": j.getAuthorization(j.pushConf.JPush.AppKey, j.pushConf.JPush.MasterSecret),
},
po,
resp,

@ -213,12 +213,12 @@ type Push struct {
FilePath string `mapstructure:"filePath"`
AuthURL string `mapstructure:"authURL"`
} `mapstructure:"fcm"`
JPNS struct {
JPush struct {
AppKey string `mapstructure:"appKey"`
MasterSecret string `mapstructure:"masterSecret"`
PushURL string `mapstructure:"pushURL"`
PushIntent string `mapstructure:"pushIntent"`
} `mapstructure:"jpns"`
} `mapstructure:"jpush"`
IOSPush struct {
PushSound string `mapstructure:"pushSound"`
BadgeCount bool `mapstructure:"badgeCount"`

Loading…
Cancel
Save