openimsdk / open-im-server

IM Chat
https://openim.io
Apache License 2.0
13.89k stars 2.44k forks source link

When I send a message using the sendMessageNotOss function, I get the error message "10002 unexpected end of JSON input." #2651

Open simayubo opened 1 week ago

simayubo commented 1 week ago

OpenIM Server Version

3.8.0

Operating System and CPU Architecture

Linux (AMD)

Deployment Method

Source Code Deployment

Bug Description and Steps to Reproduce

IOS客户端创建createImageMessageByURL图片消息,通过sendMessageNotOss发送消息,报错10002 unexpected end of JSON input,服务器没有日志信息 安卓测试正常

IOS客户端sdk版本:3.8.0

Screenshots Link

No response

OpenIM-Robot commented 1 week ago

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 commented 1 week ago

You need to check whether the result of createXXX is an empty string. If it is, make sure to fetch your own user information once after logging in, before createXXX.

simayubo commented 1 week ago

You need to check whether the result of createXXX is an empty string. If it is, make sure to fetch your own user information once after logging in, before createXXX.

The returned data is normal, and Android can send it normally

{ "clientMsgID": "961296690b591a4a6e489b0f392948e9", "createTime": 1726817296151, "sendTime": 1726817296151, "sessionType": 0, "sendID": "1801542", "msgFrom": 100, "contentType": 102, "senderPlatformID": 1, "senderNickname": "遗世独立", "senderFaceUrl": "https://xxx.com/static_data/uploaddata/avatar/1/1801542.gif?_t=1683340236", "seq": 0, "isRead": false, "status": 1, "pictureElem": { "sourcePicture": { "uuid": "161a89049113f1bccad75c05aa9409", "type": "image/jpg", "size": 168453, "width": 3000, "height": 3000, "url": "https://xxx.com/static_data/uploaddata/im_file/20240920/82ff1402e0119f4a82a4a43c56efb815.jpg" }, "bigPicture": { "uuid": "161a89049113f1bccad75c05aa9409", "type": "image/jpg", "size": 168453, "width": 3000, "height": 3000, "url": "https://xxx.com/static_data/uploaddata/im_file/20240920/82ff1402e0119f4a82a4a43c56efb815.jpg" }, "snapshotPicture": { "uuid": "161a89049113f1bccad75c05aa9409", "type": "image/jpg", "size": 168453, "width": 3000, "height": 3000, "url": "https://xxx.com/static_data/uploaddata/im_file/20240920/82ff1402e0119f4a82a4a43c56efb815.jpg" } } }