Search code examples
getstream-io

Is it able to get all activities of an user?


I read the doc and try to get all the activities of a user(not the user self), but the returned json is

{
  "detail":"You don't have permission to do this",
  "status_code":403,
  "code":17,
  "exception":"NotAllowedException",
  "duration":"0.13ms"
}

This is the code I am using,

let feed = Client.shared.flatFeed(feedSlug: "public", userId: "7YZSZNpYOMU2GyRcxS1x152loPW2")
feed.get() { result in
    try? result.get().results
} 

I'm wondering if it is possible to get all activities of another user. Thanks for any help!


Solution

  • tldr: Yes, possible.

    It's a permission issue in your application. By default, users can only read their own feed. However, you can get it changed by contacting to support. Then, users will be able to read the feed of other users. Please mention the feed_group you want to make readable.

    So, there are two types of feeds in your application:

    • user: individual activities of a user go to this feed and support will enable it to be readable by anybody.
    • timeline: what a user sees by following other feeds. As far as I understand, it doesn't need to be readable by others since it will be specific to one user.