• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

在 Quickblox 中更新时 ios 无法处理的实体

[复制链接]
菜鸟教程小白 发表于 2022-12-13 05:07:47 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

我正在开发一个聊天应用程序,并添加了用于聊天的 Quickblox 框架,但是在用户更新时出现以下错误:

Request URL:https://api.quickblox.com/users/12345.json?user%5Bemail%5D=abc%40gmail.com&user%5Bfull_name%5D=abc%xyz&user%5Blogin%5D=1234567890&user%5Bpassword%5D=abcdefghij&user%5Bphone%5D=1234567890

Request method: PUT

Request headers: { "Content-Type" = "application/json"; "QB-SDK" = "iOS 2.0.12"; "QB-Token" = b9a57f30857d7591d6766dac7345d78bc1c9f588; "QuickBlox-REST-API-Version" = "0.1.1"; } Request parameters:{ user = { email = "[email protected]"; "full_name" = "abc xyz"; login = 1234567890; password = abcdefghij; phone = 1234567890; }; }

Request headers: { "Content-Type" = "application/json"; "QB-SDK" = "iOS 2.0.12"; "QB-Token" = b9a57f30857d7591d6766dac7345d78bc1c9f588; "QuickBlox-REST-API-Version" = "0.1.1"; }

Response headers: { "Access-Control-Allow-Origin" = "*"; "Cache-Control" = "no-cache"; Connection = "keep-alive"; "Content-Type" = "application/json; charset=utf-8"; Date = "Sun, 01 Feb 2015 18:59:19 GMT"; "QB-Token-ExpirationDate" = "2015-02-01 20:57:39 UTC"; "QuickBlox-REST-API-Version" = "0.1.1"; Server = "nginx/1.0.15"; Status = "422 Unprocessable Entity"; "Transfer-Encoding" = Identity; "X-Rack-Cache" = "invalidate, pass"; "X-Request-Id" = 17331b69e1b7a38d8545629e241733c8; "X-Runtime" = "0.013145"; "X-UA-Compatible" = "IE=Edge,chrome=1"; }

我使用了以下代码...

    if (firstName.length > 0 || lastName.length > 0 || email.length > 0 || mobileNo.length > 0 || country.length > 0) {

    QBUUser *user = [QBUUser user];
    AppUser *AppUser = [AppUser user];
    user.ID = AppUser.ID;
    user.login = AppUser.login;
    user.password = AppUser.password;
    user.fullName = [NSString stringWithFormat"%@ %@",firstName,lastName];
    user.email = email;
    user.phone = mobileNo;

    [QBRequest updateUser:user
             successBlock:^(QBResponse *response, QBUUser *user) {

        AppUser *AppUser = [AppUser user];
        AppUser.country = country;

        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle"Information" message"rofile updated successfully." delegate:nil cancelButtonTitle"OK" otherButtonTitles:nil];
        [alertView show];

    } errorBlock:^(QBResponse *response) {

        UIAlertView *alertView = [[UIAlertView alloc] initWithTitle"Error" message"Error while updating." delegate:nil cancelButtonTitle"OK" otherButtonTitles:nil];
        [alertView show];

    }];
} else {

    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle"Information" message"Fields can't be empty." delegate:nil cancelButtonTitle"OK" otherButtonTitles:nil];
    [alertView show];
}



Best Answer-推荐答案


首先尝试通过删除(或注释掉)上述字段之一来更新用户对象,直到找到有问题的属性。您一次更新了这么多,以至于您不知道是哪一个导致了问题。

我怀疑登录属性是来源,因为我相信它是在注册时设置和修复的,因此之后无法更新。

关于在 Quickblox 中更新时 ios 无法处理的实体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28267386/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap