stream-chat-swift
stream-chat-swift copied to clipboard
[Swift] remove current user imageURL via currentUserController
What did you do?
I have this code
func updateStreamProfile(image: URL?, completion: ((Error?) -> Void)? = nil) {
guard let extraData = data?.extraData else {
return
}
ChatClient
.shared
.currentUserController()
.updateUserData(
name: data?.name,
imageURL: image,
privacySettings: data?.privacySettings,
userExtraData: extraData,
completion: completion
)
}
it wont change whenever i set the imageURL to nil since on library file showing like this
/// Updates the current user data.
///
/// By default all data is `nil`, and it won't be updated unless a value is provided.
///
/// - Parameters:
/// - name: Optionally provide a new name to be updated.
/// - imageURL: Optionally provide a new image to be updated.
/// - privacySettings: The privacy settings of the user. Example: If the user does not want to expose typing events or read events.
/// - userExtraData: Optionally provide new user extra data to be updated.
/// - completion: Called when user is successfuly updated, or with error.
or may is there other way to remove the imageURL?
What did you expect to happen?
Can remove the imageURL, since my Android team can use empty string to store, can we just do that instead? since on swift we cannot make URL type data using the empty string
What happened instead?
Cannot remove the imageURL
GetStream Environment
**GetStream Chat version:4.55.0 GetStream Chat frameworks: StreamChat, StreamChatUI iOS version: Swift version: **Xcode version:15.4 Device:
Additional context
Hi @ikaru19,
This is indeed missing on the iOS side. We should add support for the unset functionality of this endpoint.
We will let you know once we pick this one up.
Best, Nuno