mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-13 21:45:58 +08:00
add test file
This commit is contained in:
@@ -50,6 +50,7 @@ func (f *Fcm) Push(accounts []string, alert, detailContent, operationID string,
|
||||
for _, account := range accounts {
|
||||
IosfcmToken, IosErr := db.DB.GetFcmToken(account, 1)
|
||||
AndroidfcmToken, AndroidErr := db.DB.GetFcmToken(account, 2)
|
||||
|
||||
if IosErr == nil {
|
||||
Tokens = append(Tokens, IosfcmToken)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package fcm
|
||||
|
||||
import (
|
||||
"Open_IM/internal/push"
|
||||
"fmt"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func Test_Push(t *testing.T) {
|
||||
offlinePusher := NewFcm()
|
||||
resp, err := offlinePusher.Push([]string{"test_uid"}, "哈哈", "嘿嘿", "12321", push.PushOpts{})
|
||||
assert.Nil(t, err)
|
||||
fmt.Println(resp)
|
||||
}
|
||||
Reference in New Issue
Block a user