As of April 12th, you must go to Progress SupportLink to create new support cases or to access existing cases. Please, bookmark the SupportLink URL and use the new portal to contact the support team.
How can I add new properties / attributes to a user that is created. The example code in the documentation does not seem to work or I am having problems following it.
Thanks!
// Set the userType to “CustomUser” Kinvey.sharedClient.userType = CustomUser.self
// Then you would set the variables appropriately user2.address = “2011 Apt B" user2.city = “Chicago”
// Then save it user2.save()
// You should see both the fields added to the user entity in “Users” collection
Thanks, Pranav Kinvey Support
K
Kannan
said
about 7 years ago
Hi Pranav,
Could you help how to create above the "user2" object in IOS3.0 version.I have used "fieldsAndValues" property in earlier version but not able convert to this in ios3.0
Mark Pruitt
Refer to the documentation here for a CustomUser class:
http://devcenter.kinvey.com/ios-v3.0/guides/users#CustomAttributesCustomUserObject
Lets say, you wanted to add a ‘city’ field to as well. Here is what you would do:
class CustomUser: User {
var address: String?
var city: String?
override func mapping(map: Map) {
super.mapping(map)
address <- map["address"]
city <- map["city"]
}
}
// Set the userType to “CustomUser”
Kinvey.sharedClient.userType = CustomUser.self
// Then you would set the variables appropriately
user2.address = “2011 Apt B"
user2.city = “Chicago”
// Then save it
user2.save()
// You should see both the fields added to the user entity in “Users” collection
Thanks,
Pranav
Kinvey Support
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstPranav J
Refer to the documentation here for a CustomUser class:
http://devcenter.kinvey.com/ios-v3.0/guides/users#CustomAttributesCustomUserObject
Lets say, you wanted to add a ‘city’ field to as well. Here is what you would do:
class CustomUser: User {
var address: String?
var city: String?
override func mapping(map: Map) {
super.mapping(map)
address <- map["address"]
city <- map["city"]
}
}
// Set the userType to “CustomUser”
Kinvey.sharedClient.userType = CustomUser.self
// Then you would set the variables appropriately
user2.address = “2011 Apt B"
user2.city = “Chicago”
// Then save it
user2.save()
// You should see both the fields added to the user entity in “Users” collection
Thanks,
Pranav
Kinvey Support
Kannan
Hi Pranav,
Could you help how to create above the "user2" object in IOS3.0 version.I have used "fieldsAndValues" property in earlier version but not able convert to this in ios3.0
Kinvey.sharedClient.userType = CustomUser.self
User.signup(username: "test@gmail.com", password: "test", client: Kinvey.sharedClient, completionHandler: {}
Pranav J
Take a look at this code, it should help.
Thanks,
Pranav
Kinvey Support
Kannan
-
Why do I get "Undefined symbols" errors when building with KinveyKit?
-
How do I register push tokens?
-
When using social login, to perform a log-out, do I need to log out of the social network, Kinvey, o
-
How can I assign additional properties to users?
-
Does KinveyKit support 64-bit ARM devices, such as iPhone 5s?
-
Authorization Token Invalid or Expired
-
BOOL and how it is stored in the database.
-
Offline saving throwing errors
-
Custom endpoint not able to form request object
-
Security through business logic
See all 437 topics