make Huawei configs compatible with HMS Core 4.0 (#561)
Co-authored-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
@@ -58,7 +58,7 @@ android:
|
||||
|
||||
huawei:
|
||||
enabled: true
|
||||
apikey: "YOUR_API_KEY"
|
||||
appsecret: "YOUR_APP_SECRET"
|
||||
appid: "YOUR_APP_ID"
|
||||
max_retry: 0 # resend fail notification, default value zero is disabled
|
||||
|
||||
@@ -161,10 +161,10 @@ type SectionAndroid struct {
|
||||
|
||||
// SectionHuawei is sub section of config.
|
||||
type SectionHuawei struct {
|
||||
Enabled bool `yaml:"enabled"`
|
||||
APIKey string `yaml:"apikey"`
|
||||
APPId string `yaml:"appid"`
|
||||
MaxRetry int `yaml:"max_retry"`
|
||||
Enabled bool `yaml:"enabled"`
|
||||
AppSecret string `yaml:"appsecret"`
|
||||
AppID string `yaml:"appid"`
|
||||
MaxRetry int `yaml:"max_retry"`
|
||||
}
|
||||
|
||||
// SectionIos is sub section of config.
|
||||
@@ -317,8 +317,8 @@ func LoadConf(confPath string) (ConfYaml, error) {
|
||||
|
||||
// Huawei
|
||||
conf.Huawei.Enabled = viper.GetBool("huawei.enabled")
|
||||
conf.Huawei.APIKey = viper.GetString("huawei.apikey")
|
||||
conf.Huawei.APPId = viper.GetString("huawei.appid")
|
||||
conf.Huawei.AppSecret = viper.GetString("huawei.appsecret")
|
||||
conf.Huawei.AppID = viper.GetString("huawei.appid")
|
||||
conf.Huawei.MaxRetry = viper.GetInt("huawei.max_retry")
|
||||
|
||||
// iOS
|
||||
|
||||
2
config/testdata/config.yml
vendored
2
config/testdata/config.yml
vendored
@@ -45,7 +45,7 @@ android:
|
||||
|
||||
huawei:
|
||||
enabled: true
|
||||
apikey: "YOUR_API_KEY"
|
||||
appsecret: "YOUR_APP_SECRET"
|
||||
appid: "YOUR_APP_ID"
|
||||
max_retry: 0 # resend fail notification, default value zero is disabled
|
||||
|
||||
|
||||
Reference in New Issue
Block a user