This is what I was trying to follow and that image is all I’m trying to recreate if you’re John, it shows Jane here and it shows Jane in the channels screen and if you’re Jane, it shows John. It’s not working for me though because I create a channel using val params = GroupChannelCreateParams().apply {
coverUrl = “”
name = “${yourUser.userId} & ${otherUser.userId}”
isPublic = false
userIds = listOf(yourUser.userId, otherUser.userId)
isDistinct = true
} and this is asking for an image else it won’t show an image at all. I have removed channel creation where the plus is in the top right because users aren’t supposed to be able to access that. It’s only supposed to be created on a certain action. Like if you use Tinder, you can’t create a channel with other users any time, only when you all both swipe right and then a channel is created for you all showing you the other person’s name and image. That’s what I’m trying to do.
If I add an image here it will show one image for both users and they’ll have to share a name which is why I’ve put two names up here instead of how typical messaging channels are that are 1 v 1 which is showing the other person’s name and photo.
Here’s an image showing what I mean.
If I used ChannelCreationScreen I think it’d work because it comes up for a second showing that channel for the user you just created but when I try that, it closes with an error which I reported earlier so I can’t even create a channel and enter it like that via Jetpack Compose at the moment.
But I don’t want that to be an option anyway I want to create it on my end (the channel) and then have the same functionality as the ChannelCreationScreen when it comes to creating a new channel so I’m using the create channel code under Android SDK and it does create a channel and show it if I add a message to start it with else it will be invisible.
However, it doesn’t allow for me to have the same Instagram UI that you were mentioning when I do it that way.
I apologize for the details if they’re a bit much it’s just I only have SendBird and GetStream for Jetpack Compose Chat SDKs and I’m just coming from GetStream after having issues with them and finding out you all now had a Jetpack Compose UI kit so I have no other options aside from going back if I’m unable to get it to work.
Did you set user’s profile url?! You can set user’s profile url in dashboard or our chat sdk api!
I understood that you want to show other user’s profile url. I guess the reason why you can’t see other user’s profile image is you don’t set other’s profile image.
I didn’t understand what the instgram UI is.
So the functionality of the channel creation screen, when you just told me to change those settings until the update, it created a channel just like I want but I just want with the selected user’s name and profile photo but the only difference is I want to be able to do that without the plus button in the top right to do it. I want to do it just using the code I’m calling. I saw that Channel Creation Screen has a createChannel method which I tried to use before to create the channel instead of just doing this - val params = GroupChannelCreateParams().apply {
coverUrl = ""
name = "${yourUser.userId} & ${otherUser.userId}"
isPublic = false
userIds = listOf(yourUser.userId, otherUser.userId)
isDistinct = true
}
GroupChannel.createChannel(params) { channel, e ->
if (e != null) {
Log.d("PlayShotScreen", "Error creating channel = $e")
// Handle error.
}
Yes, I think there’s no problem…! What is the problem?!
The image below, in the top right, has the plus button that takes you to the CreateChannelScreen where you can create a channel. I don’t want to allow users to create channels this way. I want to create the channels based upon another action so when I call this method which I found in the viewmodel for creation screen -
val vm = viewModel<ChannelCreationViewModel>(
factory = ChannelCreationViewModel.factory(
ChannelCreationViewModelParams(ApplicationUserListQueryParams())
)
)
val users = listOf(yourUser.userId, otherUser.userId)
vm.createChannel(users)
-
nothing happens. It doesn’t create a new channel like it does when you go to the screen and select a user. But I have to be able to do the same thing going to the screen does and selecting a user but without giving the user that option so I have to remove that plus action button.
-
However, I have no way of being able to make the channel showing their name and profile photo because when I create it using GroupChannel.create - it doesn’t allow me the option to make it the same way that the view model does.
- You can remove create button like below code.
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun ChannelsScreenExample(
navController: NavHostController
) {
ChannelsScreen(
navController = navController,
topBar = { onNavigationIconClick, _ ->
ChannelsTopBar(
action = {},
onNavigationIconClick = onNavigationIconClick
)
}
)
}
- When you create channel, you can user
GroupChannel.createChannel(params)
in Chat SDK. Channel cover is drawn by channel cover or members’s profile (If channel cover is empty).
OK so I know how to remove the action bar but my issue was making that createChannel method retrieve the member’s profile name and photo like the ChannelCreationScreen.createChannel method does. so I will leave these two empty and try again -
var coverImage: File?
The cover image of the channel. Defaults to null. If coverUrl was set after, this will be reset to null.
The cover image’s url of the channel. Defaults to null. If coverImage was set after, this will be reset to null.
IT WORKED! I just had to remove name as well because I thought I had to set that and it pre-populated to the name of the user. Thank you @Doo_Rim for working through this with me.
I’m glad it works! Thank you!
I’m having issues with the images for some reason. When I go to the dashboard I see the nickname, id, and the photo for the user but I don’t see the image in the channels. I’ve tried calling it like this -
val params = GroupChannelCreateParams().apply {
coverUrl = ""
userIds = listOf(yourUser.userId, otherUser.userId)
isPublic = false
isDistinct = true
}
and like this
val params = GroupChannelCreateParams().apply {
userIds = listOf(yourUser.userId, otherUser.userId)
isPublic = false
isDistinct = true
}
Neither are working far as showing the image right now.
When I look at it in the dashboard the images show but for some reason, they’re not up here.
Could you explain how different between dashboard image and uikit image?
Sure, here are the images for dashboard and then the emulator in android studio. You’ll see that one is missing its image but the images always show on the dashboard.
I guess Geraldine! doesn’t have profile image.
Default image of channel is different between UIKit and Dashboard.
As you see, The Chat Icon image is shown in Dashboard. On the other hand, UIKit shows empty profile icon.
UIKit channel shows the user’s profile image except for the current user.
In your case, Camila! is the current user. So, Geraldline! channel cannot show any profile image on the channel list.
But every user I’ve created has a nickname and an image and their image showing up is imperative to the app so how would I go about making sure that’s there?
See -
Actually, the only one that has an image showing is Lisa even if I log in to other users none ever have an image. If I understand what you were explaining, I should see the other user’s images (I may have that confused).
I think you need to check the log when loading channels.
Please add below code before showing channels
SendbirdUikitCompose.loggerLevel = LoggerLevel.Error