mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-11-04 19:32:17 +08:00
fix:config name and annotation
This commit is contained in:
parent
cb47d57ccd
commit
9ae653c32d
@ -23,8 +23,9 @@ geTui:
|
|||||||
channelID: ''
|
channelID: ''
|
||||||
channelName: ''
|
channelName: ''
|
||||||
fcm:
|
fcm:
|
||||||
serviceAccount: "x.json"
|
# Prioritize using file paths. If the file path is empty, use URL
|
||||||
authUrl: ""
|
serviceAccount: "" # File path is concatenated with the parameters passed in through - c and serviceAccount.
|
||||||
|
authURL: "" # file URL. Protocol must be specified.
|
||||||
jpns:
|
jpns:
|
||||||
appKey: ''
|
appKey: ''
|
||||||
masterSecret: ''
|
masterSecret: ''
|
||||||
|
|||||||
@ -42,10 +42,6 @@ type Fcm struct {
|
|||||||
// NewClient initializes a new FCM client using the Firebase Admin SDK.
|
// NewClient initializes a new FCM client using the Firebase Admin SDK.
|
||||||
// It requires the FCM service account credentials file located within the project's configuration directory.
|
// It requires the FCM service account credentials file located within the project's configuration directory.
|
||||||
func NewClient(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath string) (*Fcm, error) {
|
func NewClient(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath string) (*Fcm, error) {
|
||||||
//projectRoot, err := config.GetProjectRoot()
|
|
||||||
//if err != nil {
|
|
||||||
// return nil, err
|
|
||||||
//}
|
|
||||||
var opt option.ClientOption
|
var opt option.ClientOption
|
||||||
switch {
|
switch {
|
||||||
case len(pushConf.FCM.ServiceAccount) != 0:
|
case len(pushConf.FCM.ServiceAccount) != 0:
|
||||||
@ -53,7 +49,7 @@ func NewClient(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath stri
|
|||||||
credentialsFilePath := filepath.Join(fcmConfigPath, pushConf.FCM.ServiceAccount)
|
credentialsFilePath := filepath.Join(fcmConfigPath, pushConf.FCM.ServiceAccount)
|
||||||
opt = option.WithCredentialsFile(credentialsFilePath)
|
opt = option.WithCredentialsFile(credentialsFilePath)
|
||||||
case len(pushConf.FCM.AuthUrl) != 0:
|
case len(pushConf.FCM.AuthUrl) != 0:
|
||||||
// with authentication url
|
// with authentication URL
|
||||||
client := httputil.NewHTTPClient(httputil.NewClientConfig())
|
client := httputil.NewHTTPClient(httputil.NewClientConfig())
|
||||||
resp, err := client.Get(pushConf.FCM.AuthUrl)
|
resp, err := client.Get(pushConf.FCM.AuthUrl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -73,7 +69,6 @@ func NewClient(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath stri
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errs.Wrap(err)
|
return nil, errs.Wrap(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &Fcm{fcmMsgCli: fcmMsgClient, cache: cache}, nil
|
return &Fcm{fcmMsgCli: fcmMsgClient, cache: cache}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -203,7 +203,7 @@ type Push struct {
|
|||||||
} `mapstructure:"geTui"`
|
} `mapstructure:"geTui"`
|
||||||
FCM struct {
|
FCM struct {
|
||||||
ServiceAccount string `mapstructure:"serviceAccount"`
|
ServiceAccount string `mapstructure:"serviceAccount"`
|
||||||
AuthUrl string `mapstructure:"authUrl"`
|
AuthUrl string `mapstructure:"authURL"`
|
||||||
} `mapstructure:"fcm"`
|
} `mapstructure:"fcm"`
|
||||||
JPNS struct {
|
JPNS struct {
|
||||||
AppKey string `mapstructure:"appKey"`
|
AppKey string `mapstructure:"appKey"`
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user