在QuickBlox中,我们获得了在QuickBlox中注册的每个用户的QBUUser实例。但是我没有找到任何属性来设置个人资料照片的化身url并更新它。我在考虑在property customData中设置url。这是正确的方式设置阿凡达网址,或如果有任何其他方式存在,让我知道。提前谢谢。
发布于 2014-12-26 13:51:51
最后,我对customData在QBUUser中的属性表示满意。
我刚刚创建了一本字典,并在字典中设置了url键。
而不是创建它的JSON字符串,并在QBUUser属性customData中设置它,并更新它,它就可以工作了。下面是它的小代码片段。
QBUUser *user = [QBUUser user];
user.ID = qbUserID; // Set User id so it updates that user
NSDictionary *dict = @{kUserPicture:@"myprofileurl.png"}; // Created dictionary to store Avatar URl
user.customData=[dict JSONRepresentation]; // Created its Json String
[QBRequest updateUser:user successBlock:^(QBResponse *response, QBUUser *user) {
NSLog(@"customData %@",user.customData);
} errorBlock:^(QBResponse *response) {
}];在成功的阻碍中我得到了这样的回应
ID:qbID
已创建位置:2014-12-26 13:04:56 +0000更新时间:2014-12-26 13:05:02 +0000
外部用户标识:45454 facebookID:(null) twitterID:(null)
全名:blabla
email:blabla@gmail.com
login:blabla@gmail.com
电话:9999999999
标签:(Null)
lastRequestAt:2014-12-26 13:39:24 +0000
customData:{"user_picture":"myprofileurl.png"}网站:(Null)
发布于 2014-12-26 10:12:57
这是正确的方法
此外,还有一个blobId字段来设置来自内容模块的文件id。
下面是一个如何实现它的示例,.28avatar.29
https://stackoverflow.com/questions/27620666
复制相似问题