You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 13, 2026. It is now read-only.
Alexey Bukhtin edited this page Feb 28, 2019
·
1 revision
Targeting Using the "TO" Field
Use Case: Mentions
// Add the activity to Eric's feed and to Jessica's notification feed:
letactivity=TweetActivity(actor:"user:Eric",
verb:"tweet",
object:"tweet:id",
feedIds:[FeedId(feedSlug:"notification", userId:"Jessica")],
message:"@Jessica check out getstream.io it's awesome!")
userFeed1.add(activity){ result in /* ... */ }
// In production use user ids, not their usernames.
Use Case: Organizations & Topics
// The TO field ensures the activity is send to the player, match and team feed
letactivity=MatchActivity(actor:"Player:Suarez",
verb:"foul",
object:"Player:Ramos",
match:Match(name:"El Clasico", id:10),
feedIds:[FeedId(feedSlug:"team", userId:"barcelona"),FeedId(feedSlug:"match", userId:"1")])
playerFeed1.add(activity){ result in /* ... */ }