GetStream / stream-swift

Swift client for Stream API
https://getstream.io
BSD 3-Clause "New" or "Revised" License
35 stars 26 forks source link

Custom Activity Issue #12

Closed fchauvin closed 4 years ago

fchauvin commented 4 years ago

Hi there!

I'm attempting to add a custom activity type, by subclassing Activity, but there seems to be inconsistencies between the guides and the repo.

The guides say that actor should be a string, and the example subclass in Custom Fields, takes in string as an actor, as seen by the super.init call. However the repo seems to force actor to be a User. This causes issues with our backend as we have our actors as strings, and not objects.

How can I specify the actor to be a String and not a User.

Thanks!

fchauvin commented 4 years ago

Or is it meant to create a subclass of EnrichedActivity by specifying the ActorType as a String? The guide should be updated if so!

buh commented 4 years ago

Hi @fchauvin! Thanks! Yes, we'll update docs. In the Activity type, the actor by default is a User, because feeds by default make enrich requests. The Activity itself is a typealias from EnrichedActivity. You right, you need to use EnrichedActivity directly for your custom activity. Please, additionally check wiki pages here.