如何为 QBChat 设置 currentUser()?

How to set currentUser() for QBChat?

如何设置当前用户如下?

非常感谢

guard let currentUser = ServicesManager.instance().currentUser() else{
      return
    }

    currentUser.fullName = defaultCurrentUserFullName
    currentUser.password = defaultCurrentUserPassword


error shown
2017-05-28 05:51:58.346 FreeChat[2615:41904] Init - QMAuthService service...
2017-05-28 05:51:58.347 FreeChat[2615:41904] Init - QMChatService service...
2017-05-28 05:51:58.350 FreeChat[2615:41967] [QBCore] Restoring QBSession,  status = -25300. See "Security Error Codes" (SecBase.h)
2017-05-28 05:51:58.355 FreeChat[2615:41904] Init - QMUsersService service...

您应该使用该用户登录。

/**
 *  User login
 *
 *  @param user       QuickBlox User
 *  @param completion completion block
 *
 *  @return Cancelable request
 */
- (QBRequest *)logInWithUser:(QBUUser *)user
                  completion:(nullable void(^)(QBResponse *response, QBUUser * _Nullable userProfile))completion;

我们将 ServicesManager.instance().currentUser() 方法设置为只读 属性 或在未来的版本中将其删除。