iOS- 获取用户缩略头像时报错, [注册的时候有上传头像]


(Benson) #1

25%20AM

Printing description of error:
Error Domain=jmsg_error Code=861101 “download mediaId or path or url shouldn’t be nil” UserInfo={NSLocalizedDescription=download mediaId or path or url shouldn’t be nil}

打印消息


#2

注册的时候并不支持上传头像
image

请检查是否有使用更新用户信息的 API 上传头像


(Benson) #3

我有调用更新用户头像的API.

        [JMSGUser updateMyAvatarWithData:resizedImageData avatarFormat:@"" completionHandler:^(id resultObject, NSError *error) {
        }];

#4

提供下你完整的客户端日志,从初始化,注册,上传头像,获取头像


(Benson) #5

稍等. 我再重现一下…


(Benson) #6

注册调用JMSGUser的"updateMyAvatarWithData:"API上传头像返回是正确的, error为nil. 然后获取头像也是对的, 但是当我注销重新登录后, 再次获取用户的头像时, 就报错:
“download mediaId or path or url shouldn’t be nil”


#7

将这个日志提供一下看看。


(Benson) #8
> 2018-09-07 10:21:24.032060+0800 NSAer[75857:31094417]  | JIGUANG | I - [JMessage] this is official version SDK.
> 2018-09-07 10:21:24.379167+0800 NSAer[75857:31094418]  | JIGUANG | I - [JMSGClientController] 
> 2018-09-07 10:21:24.383479+0800 NSAer[75857:31094448]  | JIGUANG | I - [JMSGClientController] Action - jmessage setup
> 2018-09-07 10:21:24.389356+0800 NSAer[75857:31094448]  | JIGUANG | I - [JIGUANGClientController] Action - setup
> 2018-09-07 10:21:24.769306+0800 NSAer[75857:31094418]  | JIGUANG | I - [JIGUANGSessionController] connecting with coreAddr 121.46.25.203,port 7001
> 2018-09-07 10:21:24.905039+0800 NSAer[75857:31094418]  | JIGUANG | I - [JMSGBadgeNumberReport] send badge:0 parameter check failed!
> 2018-09-07 10:21:24.992289+0800 NSAer[75857:31094418]  | JIGUANG | I - [JIGUANGLogin] 
> 2018-09-07 10:21:25.111575+0800 NSAer[75857:31094418]  | JIGUANG | I - [JMSGBadgeNumberReport] set badge:0 succeed
> 2018-09-07 10:21:25.289330+0800 NSAer[75857:31094409]  | JIGUANG | I - [JMSGUser+JMSGInner] report sdkversion success
> 2018-09-07 10:22:01.849784+0800 NSAer[75857:31094419]  | JIGUANG | I - [JIGUANGIMEventNotification] Unexpected:head uid doesn't equal current user uid or loginState unexpected.
> 2018-09-07 10:22:01.921627+0800 NSAer[75857:31094419]  | JIGUANG | I - [JMessage+JMSGInner] Action - jmsg_clearCurrentUser
> 2018-09-07 10:22:01.927339+0800 NSAer[75857:31094783]  | JIGUANG | I - [JMSGUser] tcp login user success, user =  <JMSGUser, 0x6040001d0b30> - [ARRAY - uid:163540643, username:32890, nickname:<null>, noteName:<null>, noteText:<null>, gender:0, birthday:<null>, avatar:<null>, region:<null>, siganature:<null>, address:<null>, createTime:<null>, extras:<null>, appKey:da14acdf1e49c1ddb5e8f864]
> 2018-09-07 10:22:07.547477+0800 NSAer[75857:31094781]  | JIGUANG | I - [JMSGStoreFileManager] saved avatarPath: /Users/apple/Library/Developer/CoreSimulator/Devices/5C8A6AC5-D4AD-40E0-9B32-6C1CB6FF941A/data/Containers/Data/Application/7379829C-F3DA-4930-8850-4F25C30C4812/Documents/32890_163540643/avatar/32890_da14acdf1e49c1ddb5e8f864/large/A5471D67720F05363D96A486063AFCA0
> 2018-09-07 10:22:15.267711+0800 NSAer[75857:31094782]  | JIGUANG | I - [JMessage+JMSGInner] Action - jmsg_clearCurrentUser
> 2018-09-07 10:22:25.546970+0800 NSAer[75857:31094419]  | JIGUANG | E - [JMessage+JMSGInner] user didn't login, please login first!
> 2018-09-07 10:22:25.791032+0800 NSAer[75857:31094781]  | JIGUANG | I - [JMessage+JMSGInner] Action - jmsg_clearCurrentUser
> 2018-09-07 10:22:25.795511+0800 NSAer[75857:31094781]  | JIGUANG | I - [JMSGUser] tcp login user success, user =  <JMSGUser, 0x6040001d78e0> - [ARRAY - uid:163540643, username:32890, nickname:<null>, noteName:<null>, noteText:<null>, gender:0, birthday:<null>, avatar:<null>, region:<null>, siganature:<null>, address:<null>, createTime:<null>, extras:<null>, appKey:da14acdf1e49c1ddb5e8f864]
> 2018-09-07 10:22:26.690805+0800 NSAer[75857:31095050]  | JIGUANG | E - [JMSGHttpManager] something wrong with serverId :https: or mediaId :https://www.yepapp.tech/nsaer//uploads/sculpture/20180907/17e1f61da90994346e17e0ceb00997ae.png
>

#9

你给的日志里面并没有报错「download mediaId or path or url shouldn’t be nil」

提供完整的日志

当前日志看到的报错信息,一个是没有登录的时候调了其他 API 导致报错,一个是 mediaId 有误而报错


(Benson) #10

something wrong with serverId :https: or mediaId :https://www.yepapp.tech/nsaer//uploads/sculpture/20180907/17e1f61da90994346e17e0ceb00997ae.png 这个是啥意思?


(翻不完的夏天) #11

是不是你用服务端接口上传了头像,你上传了一个http链接,下载的时候就会提示这个错误


调用createSingleConversationWithUsername崩溃 #question:jmessage tags:ios
(Benson) #12

有可能, 我问问服务端…


(Benson) #13

好像就是服务端搞的鬼 :cold_sweat: