mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-06 04:15:46 +08:00
fcm push modify
This commit is contained in:
parent
787cef54f5
commit
1eda0ebea7
@ -1,4 +1,4 @@
|
||||
package push
|
||||
package fcm
|
||||
|
||||
import (
|
||||
"Open_IM/internal/push"
|
||||
@ -17,12 +17,9 @@ type Fcm struct {
|
||||
FcmMsgCli *messaging.Client
|
||||
}
|
||||
|
||||
var FcmClient *Fcm
|
||||
|
||||
func init() {
|
||||
FcmClient = newFcmClient()
|
||||
func NewFcm() *Fcm {
|
||||
return newFcmClient()
|
||||
}
|
||||
|
||||
func newFcmClient() *Fcm {
|
||||
opt := option.WithCredentialsFile(filepath.Join(config.Root, "config", config.Config.Push.Fcm.ServiceAccount))
|
||||
fcmApp, err := firebase.NewApp(context.Background(), nil, opt)
|
||||
|
@ -44,7 +44,7 @@ func init() {
|
||||
}
|
||||
|
||||
if config.Config.Push.Fcm.Enable {
|
||||
offlinePusher = fcm.FcmClient
|
||||
offlinePusher = fcm.NewFcm()
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user