I login with user login = 375251111111 and password = 1
Then I want to update this user (but I don’t want to user current user, I just want to update it with regular methods). So I create the same user, and I set him phone and password (login is phone). But I get error:
message = Unable to update user account due to error: Can not get user schema, details = Unable to update user account due to error: Can not get user schema, errorCode = 3024
BackendlessUser *userTest = [BackendlessUser new];
[userTest setProperty:@"phone" object:@"375251111111"];
userTest.password = @"";
[userTest setProperty:@"yearFrom" object:@1982];
Pavel,
Sorry, I do not understand what you wrote. For example,
Then I want to update this user (but I don't want to user current user, I just want to update it with regular methods)
What are the “regular methods”? You do not need to use “currentUser”, you can use the object which you receive as a result of the login operation (it will still be the same object though).
So I create the same user
When you do this and try to save it (if it worked), it would not update your user, but create a copy of it. So you would end up with 2 user objects.
What I do not understand is why can’t you update it using the update method? You can use either update from User Service or Data Service. There is an example here: https://backendless.com/users-and-relations-in-java-and-android/
I understand what you mean, your advice is to gain user from server (for instance during login operation) and then update this user, I understand that. And I can do this.
But I thought that if I created new user (BackendlessUser *userTest = [BackendlessUser new]) and then set main properties (login, password (and may be user id)) to this new user, I thought that in this case I would update existing user .
My question was : what properties I should set to the new user (may be additional user token) to update the existing user in the server database).
Actually, I need this to create subclass and then init my custom object with BackendlessUser (because then I will need to update this custom object and I will need to convert it to BackendlessUser one more time).
May be the best way is to use this code? :
BackendlessUser *userTest = [ [BackendlessUser alloc] initWithProperties:[ userCame getProperties]];