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.
appKey: "kid_Bym8FF-A7",
appSecret: "dc0d4dfb85bf4608ad4826a254c97066"
) {
switch $0 {
case .success(let user):
if let customUser = user as? CustomUser {
customUser.refresh()
Doesnt work for me
Best Answer
P
Pranav J
said
over 4 years ago
Hi Wood,
Please try using the following code snippet to refresh the custom user:
Kinvey.sharedClient.userType = CustomUser.self
Kinvey.sharedClient.initialize(
appKey: "kid_SkmEzxxxx",
appSecret: "f72aa24333e747feb4c25af35f3xxxxx"
) {
switch $0 {
case .success(let user):
print("entered success block")
if let user = user {
print("\(user)")
}
case .failure(let error):
print("entered error block")
print("\(error)")
}
}
let myUser = Kinvey.sharedClient.activeUser as! CustomUser
print("Active User's username: \(String(describing: myUser.username))")
print("id of the logged in user is: \(String(describing: myUser.userId))\n\n\n\n")
Kinvey.sharedClient.activeUser?.refresh() { result in
switch result {
case .success:
print("User refreshed successfully")
case .failure(let error):
print(error)
}
}
Please try using the following code snippet to refresh the custom user:
Kinvey.sharedClient.userType = CustomUser.self
Kinvey.sharedClient.initialize(
appKey: "kid_SkmEzxxxx",
appSecret: "f72aa24333e747feb4c25af35f3xxxxx"
) {
switch $0 {
case .success(let user):
print("entered success block")
if let user = user {
print("\(user)")
}
case .failure(let error):
print("entered error block")
print("\(error)")
}
}
let myUser = Kinvey.sharedClient.activeUser as! CustomUser
print("Active User's username: \(String(describing: myUser.username))")
print("id of the logged in user is: \(String(describing: myUser.userId))\n\n\n\n")
Kinvey.sharedClient.activeUser?.refresh() { result in
switch result {
case .success:
print("User refreshed successfully")
case .failure(let error):
print(error)
}
}
Thanks,
Pranav
Kinvey
b
beetv
said
about 4 years ago
Thanks for the working code Pranav sir, Would love to get more tips and tricks such as this from you.
Wood Wayfarer
Hi
Could you please help me to refresh costume user?
Doesnt work for me
Hi Wood,
Please try using the following code snippet to refresh the custom user:
Thanks,
Pranav
Kinvey
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstPranav J
Hi Wood,
Please try using the following code snippet to refresh the custom user:
Thanks,
Pranav
Kinvey
beetv
Thanks for the working code Pranav sir, Would love to get more tips and tricks such as this from you.
https://beetvapp.com/
-
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