-1

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!

ferhatelmas
  • 3,818
  • 1
  • 21
  • 25

2 Answers2

0

You can't do that. It depends on your flow, but probably instead of getting all activities from other users, the current user can follow others and get their activities.

Tap on avatar

I suppose you use Stream Activity Feed Components. You can subclass FlatFeedViewController that based on BaseFlatFeedViewController and you can override method: func updateAvatar(in cell: PostHeaderTableViewCell, activity: T) to add a callback for avatar button:

override func updateAvatar(in cell: PostHeaderTableViewCell, activity: T) {
    cell.updateAvatar(with: activity.actor) { avatarButton in
        // ... open the detail view controller
    }
}
buh
  • 440
  • 2
  • 12
  • Yes, users now are able to see all activities of all the other users they have followed. But what I also would like to do is to click a user's avatar and show the profile and all activities of the user. So this is not possible, right? Thanks. – yueheng shi Jan 07 '20 at 16:18
  • Thanks for the reply. I understand this button click event. Is there any way to get all the activities of a specific user? For example, I followed userA and userB, I can see activities they've posted in this feed group, what I would like to do is clicking userA and retrieving all activities of the userA. Is this possible to do? Thanks. – yueheng shi Jan 09 '20 at 16:17
0

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.
ferhatelmas
  • 3,818
  • 1
  • 21
  • 25