Android - Unable to get created by name & image info in QueriedCalls
Discussed in https://github.com/GetStream/stream-video-android/discussions/1130
Originally posted by vinodkumarsagitla July 4, 2024 Hello, I am using latest version "io.getstream:stream-video-android-ui-compose:1.0.9" When we call below query for ongoing stream video
val filters = mutableMapOf("ongoing" to true)
val result = cloudClientStreamVideo?.queryCalls(filters=filters, limit=25, watch=true)?.getOrNull()
then i got below response in result so we are unable to get/find createdBy user name, image in this response
QueriedCalls(calls=[CallData(blockedUsersIds=[], call=CallInfo(cid=livestream:056cb8e9-2863-417e-acd8-8aa5c98c21ed, type=livestream, id=056cb8e9-2863-417e-acd8-8aa5c98c21ed, createdByUserId=vQkCQ72k57PLaWTL54Q3BUfHL9Z2, broadcastingEnabled=true, recordingEnabled=false, createdAt=Thu Jul 04 18:20:06 GMT+05:30 2024, updatedAt=Thu Jul 04 18:20:06 GMT+05:30 2024, custom={}), members=[], ownMembership=null)], next=null, prev=null)
So please can you help
If you have cached users you can use the ID of the createdByUserId to find it in the DB. If not, you need to load the data for the call and extract the createdBy from there.
Something in the line of this:
val imageNamePair = StreamVideo.instance().call("livestream", "056cb8e9-2863-417e-acd8-8aa5c98c21ed")
.get()
.map {
it.call.createdBy
}.map {
val name = it.name
val image = it.image
Pair(name, image)
}.getOrNull()
Let me know if it works for you or if there is any way we can help you further.
@aleksandar-apostolov Thanks for your suggestions.
But this is not a best solution for me because we have list of calls (for e.g 25 records) ( QueriedCalls(calls=[...], next=null, prev=null) ) then we need to make request multiple times(e.g. 25 times) for get values for each calls in list.
So please can you have any other way to get this data for multiple calls at single request
@aleksandar-apostolov Any update?
Hey @vinodkumarsagitla Sorry for the delay in response, currently I see no other way to do it. We will pick it up as a feature request, but this is low on our priority list.
Will keep you posted.
Regards, Alex