GetStream / stream-java

Java Client - Build Activity Feeds & Streams with GetStream.io
https://getstream.io
BSD 3-Clause "New" or "Revised" License
55 stars 48 forks source link

Get activity by id #92

Open samoilovich opened 3 years ago

samoilovich commented 3 years ago

Hello.

I have a problem. I need to get activity by id in Android. Does Java lib have something simiIar to iOs? https://github.com/GetStream/stream-swift/wiki/Activities#advanced

// retrieve two activities by ID:
Client.shared.get(typeOf: Activity.self, activityIds: ["01b3c1dd-e7ab-4649-b5b3-b4371d8f7045", 
                                             "ed2837a6-0a3b-4679-adc1-778a1704852d"])

Could you help with that?

Thank you.

shodgetts commented 3 years ago

Agent comment from Anders Lund in Zendesk ticket #11227:

Hi there,

Sure, I'd recommend taking a look at our documentation on this here: https://getstream.io/activity-feeds/docs/java/add_many_activities/?language=java. I hope this helps

samoilovich commented 3 years ago

@shodgetts Thank you for quick answer. Sorry, but not really. Some problems with that: 1) If I try to get activitie swith batch client (and I have tried that) I have an exception:

java.util.concurrent.ExecutionException: io.getstream.core.exceptions.StreamAPIException: NotAllowedException: signature is invalid (code = 17 status = 403)

https://github.com/GetStream/feeds-sample-android/issues/1

2) And in the documentation if you switch from Java to Swift the axample looks like

// retrieve two activities by ID: 
client.get(typeOf: Activity.self, activityIds: ["01b3c1dd-e7ab-4649-b5b3-b4371d8f7045", 
                                                "ed2837a6-0a3b-4679-adc1-778a1704852d"]) { result in 
    /* ... */  
} 

but not Client.shared.get as in my description above.

samoilovich commented 3 years ago

@shodgetts Any ideas about that situation? I need to go forward and implement a feature to get activity by id. For now I am stuck with that. We have iOs, Android and web application. And If Android doesn't have variants to resolve that we need to rewrite our logic in a different way. Thank you.

ferhatelmas commented 3 years ago

This is missing from cloud client even if client has it. Will be added.