Hello,
I’m new iOS developper with Backendless and I’ve actually a problem, when I’m connected on my application with admin user and when I’m trying to update the properties of an other user, there is this error :
Server reported an error (1): Optional(FAULT = '3017' [User property with name 'lastLogin' already exists.] <User property with name 'lastLogin' already exists.> )
It’s my code:
func toggleAgent(sender: String, agent: BackendlessUser, completion: @escaping (_ result: String) -> Void) {
let user = agent
var props:[String: Bool] = [:]
if(sender == "tapActivateAgent") {
props = [
"status" : true
]
}
else if(sender == "tapDesactivateAgent") {
props = [
"status" : false
]
}
backendless?.userService.registering(user,
response: { (registeredUser : BackendlessUser?) -> Void in
print("User has been updated (ASYNC): \(registeredUser)")
let properties = props
registeredUser!.updateProperties( properties )
self.backendless?.userService.update(registeredUser,
response: { ( updatedUser : BackendlessUser?) -> Void in
print("Updated user: \(updatedUser)")
},
error: { ( fault : Fault?) -> Void in
print("Server reported an error (2): \(fault)")
})
},
error: { ( fault : Fault?) -> Void in
print("Server reported an error (1): \(fault)")
}
)
}
In advance, thanks.