mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-17 15:29:03 +08:00
* fix: offline push can display badge * feat: strategy * feat: log * feat: log * chore: offlinepush * fix: offlinepush * fix: log Co-authored-by: icey-yu <119291641+icey-yu@users.noreply.github.com>
This commit is contained in:
@@ -16,12 +16,14 @@ package fcm
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options"
|
||||
"github.com/openimsdk/tools/utils/httputil"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
||||
"github.com/openimsdk/open-im-server/v3/internal/push/offlinepush/options"
|
||||
"github.com/openimsdk/tools/utils/httputil"
|
||||
|
||||
firebase "firebase.google.com/go/v4"
|
||||
"firebase.google.com/go/v4/messaging"
|
||||
"github.com/openimsdk/open-im-server/v3/pkg/common/config"
|
||||
@@ -133,7 +135,7 @@ func (f *Fcm) Push(ctx context.Context, userIDs []string, title, content string,
|
||||
unreadCountSum, err := f.cache.GetUserBadgeUnreadCountSum(ctx, userID)
|
||||
if err == nil && unreadCountSum != 0 {
|
||||
apns.Payload.Aps.Badge = &unreadCountSum
|
||||
} else if err == redis.Nil || unreadCountSum == 0 {
|
||||
} else if errors.Is(err, redis.Nil) || unreadCountSum == 0 {
|
||||
zero := 1
|
||||
apns.Payload.Aps.Badge = &zero
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user