Concepts - GetStream/stream-swift GitHub Wiki

Targeting Using the "TO" Field

Use Case: Mentions

// Add the activity to Eric's feed and to Jessica's notification feed:
let activity = 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
let activity = 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 /* ... */ }