Greetings,
We are trying to set the image URL for a new user and are receiving an error
“currentUserId
cannot be nil.”
I am not sure why the currentUserId is nil since it seemed the device was successfully registered.
AmityUIKitManager.setup(apiKey: "", region: .US)
client = try! AmityClient(apiKey: "", region: .US)
AmityUIKitManager.registerDevice(withUserId: userId, displayName: displayName) { [weak self] success, error in
print("[Sample App] register device with userId '\(userId)' \(success ? "successfully" : "failed")")
if let error = error {
print("[Sample App] register device failed \(error.localizedDescription)")
}
// Build the current user data
let builder = AmityUserUpdateBuilder()
builder.setAvatarCustomUrl(imageUrl)
// Update the current user from the builder
client?.updateUser(builder) { status, error in
// Handle the result
}