Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] jpush offlinePushMsg failed #2706

Open
EDaoren opened this issue Oct 10, 2024 · 2 comments
Open

[BUG] jpush offlinePushMsg failed #2706

EDaoren opened this issue Oct 10, 2024 · 2 comments
Labels
bug Categorizes issue or PR as related to a bug.

Comments

@EDaoren
Copy link

EDaoren commented Oct 10, 2024

OpenIM Server Version

3.8.0

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

我配置了jpush的离线推送,并没有成功,有以下问题:
openim-push.yml 配置文件
`#Use geTui for offline push notifications, or choose fcm or jpns; corresponding configuration settings must be specified.
enable: jpns
geTui:
pushUrl: https://restapi.getui.com/v2/$appId
masterSecret:
appKey:
intent:
channelID:
channelName:
fcm:

Prioritize using file paths. If the file path is empty, use URL

filePath: # File path is concatenated with the parameters passed in through - c(mage default pass in config/) and filePath.
authURL: # Must start with https or http.
jpns:
appKey: xxxxxx
masterSecret: xxxxxxx
pushURL: xxxxxx
pushIntent: `

按照配置文件注释的提示,我配置 enable 以及相关的 appKey 和 masterSecret,发现推送的时候并没有反应,
查看源代码发现如下:
`const (
geTUI = "geTui"
firebase = "fcm"
jPush = "jpush"
)

func NewOfflinePusher(pushConf *config.Push, cache cache.ThirdCache, fcmConfigPath string) (OfflinePusher, error) {
var offlinePusher OfflinePusher
log.Print("使用什么推送(pushConf.Enable):", pushConf.Enable)
switch pushConf.Enable {
case geTUI:
offlinePusher = getui.NewClient(pushConf, cache)
case firebase:
return fcm.NewClient(pushConf, cache, fcmConfigPath)
case jPush:
offlinePusher = jpush.NewClient(pushConf)
default:
offlinePusher = dummy.NewClient()
}
return offlinePusher, nil
}
`
按照配置文件注释,enable = ‘jpns’,switch 判断逻最终会走 default,没有走jpush,我修改配置文件 enable = ‘jpush’,正常走jpush逻辑了,也发起jpush推送了,但推送并没有成功推送。

日志异常信息如下:
2024-10-10 18:40:27.607 DEBUG [PID:126238] openim-push [version:3.8.0] [jpush/push.go:56] 执行极光推送------------ {"platform": "Web", "connID": "856ab48d22c5a6b99ccaab2ddf80c5c7", "operationID": "659f1035-2602-443b-9d51-a1eeea3d1ab6", "opUserID": "3373149053"} 2024-10-10 18:40:27.854 WARN [PID:126238] openim-push [version:3.8.0] [push/push_handler.go:178] offlinePushMsg failed {"platform": "Web", "connID": "856ab48d22c5a6b99ccaab2ddf80c5c7", "operationID": "659f1035-2602-443b-9d51-a1eeea3d1ab6", "opUserID": "3373149053", "offlinePushUserID": ["222581\"3373149053\" recvID:\"2225814255\" clientMsgID:\"81457366bba5d3d4a4dd1c3d21e883df\" serverMsgID:\"f93cb24962f15bb31ee5b5256447e69e\" senderPlatformID:5 senderNickname:\"chen\" 100 contentType:101 content:\"{\\\"content\\\":\\\"1111\\\"}\" seq:8 sendTime:1728556827517 createTime:1728556827795 status:1 offlinePushInfo:{title:\"你有一条新消息\" iOSPushSunt:true} attachedInfo:\"null\"", "error": "JSON unmarshal failed: json: Unmarshal(nil)"}

我go语言不太熟悉,请问这是什么问题?

Screenshots Link

image

@EDaoren EDaoren added the bug Categorizes issue or PR as related to a bug. label Oct 10, 2024
@OpenIM-Robot
Copy link

Hello! Thank you for filing an issue.

If this is a bug report, please include relevant logs to help us debug the problem.

Join slack 🤖 to connect and communicate with our developers.

@FGadvancer
Copy link
Member

If your discovery.yaml configuration uses ZooKeeper, it is recommended to switch to etcd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants