Skip to content

Commit

Permalink
refactor:change FCM config name
Browse files Browse the repository at this point in the history
  • Loading branch information
icey-yu committed Jun 12, 2024
1 parent 9ae653c commit 2aed1fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/openim-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ geTui:
channelName: ''
fcm:
# Prioritize using file paths. If the file path is empty, use URL
serviceAccount: "" # File path is concatenated with the parameters passed in through - c and serviceAccount.
filePath: "" # File path is concatenated with the parameters passed in through - c(`mage` default pass in `config/`) and serviceAccount.
authURL: "" # file URL. Protocol must be specified.
jpns:
appKey: ''
Expand Down
4 changes: 2 additions & 2 deletions internal/push/offlinepush/fcm/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ type Fcm struct {
func NewClient(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath string) (*Fcm, error) {
var opt option.ClientOption
switch {
case len(pushConf.FCM.ServiceAccount) != 0:
case len(pushConf.FCM.FilePath) != 0:
// with file path
credentialsFilePath := filepath.Join(fcmConfigPath, pushConf.FCM.ServiceAccount)
credentialsFilePath := filepath.Join(fcmConfigPath, pushConf.FCM.FilePath)
opt = option.WithCredentialsFile(credentialsFilePath)
case len(pushConf.FCM.AuthUrl) != 0:
// with authentication URL
Expand Down
4 changes: 2 additions & 2 deletions pkg/common/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ type Push struct {
ChannelName string `mapstructure:"channelName"`
} `mapstructure:"geTui"`
FCM struct {
ServiceAccount string `mapstructure:"serviceAccount"`
AuthUrl string `mapstructure:"authURL"`
FilePath string `mapstructure:"filePath"`
AuthUrl string `mapstructure:"authURL"`
} `mapstructure:"fcm"`
JPNS struct {
AppKey string `mapstructure:"appKey"`
Expand Down

0 comments on commit 2aed1fd

Please sign in to comment.