diff --git a/internal/push/offlinepush/dummy/push.go b/internal/push/offlinepush/dummy/push.go new file mode 100644 index 000000000..1be234d68 --- /dev/null +++ b/internal/push/offlinepush/dummy/push.go @@ -0,0 +1,17 @@ +package dummy + +import ( + "context" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush" +) + +func NewClient() *Dummy { + return &Dummy{} +} + +type Dummy struct { +} + +func (d *Dummy) Push(ctx context.Context, userIDs []string, title, content string, opts *offlinepush.Opts) error { + return nil +} diff --git a/internal/push/push_to_client.go b/internal/push/push_to_client.go index 8f671c21d..61d094d27 100644 --- a/internal/push/push_to_client.go +++ b/internal/push/push_to_client.go @@ -18,6 +18,7 @@ import ( "context" "encoding/json" "errors" + "github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/dummy" "github.com/OpenIMSDK/protocol/conversation" @@ -82,6 +83,8 @@ func NewOfflinePusher(cache cache.MsgModel) offlinepush.OfflinePusher { offlinePusher = fcm.NewClient(cache) case "jpush": offlinePusher = jpush.NewClient() + default: + offlinePusher = dummy.NewClient() } return offlinePusher }