EkoChannelParticipation

@interface EkoChannelParticipation : NSObject

A membership encapsulates methods for managing users in a channel

  • The client used to create the instance

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull) EkoClient *client;

    Swift

    var client: EkoClient { get }
  • The channel Id associated with the instance

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull) NSString *channelId;

    Swift

    var channelId: String { get }
  • The memberships associated with the channel

    Declaration

    Objective-C

    @property (readonly, strong, nonatomic, nonnull) EkoCollection<EkoChannelMembership *> *memberships;

    Swift

    var memberships: EkoCollection<EkoChannelMembership> { get }
  • Designated intializer

    Declaration

    Objective-C

    - (nonnull instancetype)initWithClient:(nonnull EkoClient *)client
                                andChannel:(nonnull NSString *)channelId;

    Swift

    init(client: EkoClient, andChannel channelId: String)

    Parameters

    client

    A valid client instance

    channelId

    The Id of the channel to update

  • Leaves the channel for the current user

    Declaration

    Objective-C

    - (void)leaveWithCompletion:(EkoRequestCompletion _Nullable)completion;

    Swift

    func leave(completion: EkoRequestCompletion? = nil)

    Parameters

    completion

    A block executed when the request has completed

  • Gets the members associated with the instance filtered by the filter parameter

    Declaration

    Objective-C

    - (nonnull EkoCollection<EkoChannelMembership *> *)membershipsForFilter:
        (EkoChannelMembershipFilter)filter;

    Swift

    func memberships(for filter: EkoChannelMembershipFilter) -> EkoCollection<EkoChannelMembership>

    Parameters

    filter

    A vaild EkoChannelMembershipFilter enum option

  • Adds users to the channel

    Declaration

    Objective-C

    - (void)addUsers:(nonnull NSArray<NSString *> *)userIds
          completion:(EkoRequestCompletion _Nullable)completion;

    Swift

    func addUsers(_ userIds: [String], completion: EkoRequestCompletion? = nil)

    Parameters

    userIds

    An array of users Ids to add

    completion

    A block executed when the request has completed

  • Removes users from the channel

    Declaration

    Objective-C

    - (void)removeUsers:(nonnull NSArray<NSString *> *)userIds
             completion:(EkoRequestCompletion _Nullable)completion;

    Swift

    func removeUsers(_ userIds: [String], completion: EkoRequestCompletion? = nil)

    Parameters

    userIds

    An array of users Ids to remove

    completion

    A block executed when the request has completed

  • Let the server know that the user is currently viewing this channel (this automatically updates the user’s readToSegment) A user can read multiple channels at the same time.

    Declaration

    Objective-C

    - (void)startReading;

    Swift

    func startReading()
  • Let the server know that the user has stopped reading this channel (this automatically updates the user’s readToSegment)

    Declaration

    Objective-C

    - (void)stopReading;

    Swift

    func stopReading()
  • Unavailable

    Block call of init and new because this object cannot be created directly

    Declaration

    Objective-C

    - (nonnull instancetype)init;