EkoChannelRepository
@interface EkoChannelRepository : NSObject <EkoChannelFeedServicable>
Repository provides access channel and collections of channels
-
Deprecated
Deprecated start from 3.0, this no longer be supported in the long term, please use channel collection with builder instead.
Returns a collection of all channels where the user is in, filtered by the specific mode
Declaration
Objective-C
- (nonnull EkoCollection<EkoChannel *> *)channelsForFilter: (EkoChannelQueryFilter)filter;
Swift
func channels(for filter: EkoChannelQueryFilter) -> EkoCollection<EkoChannel>
Parameters
filter
Indicates whether we want channels where the user is member, not member, or both
Return Value
Collection instance
-
Create a channel
Declaration
Objective-C
- (nonnull EkoObject<EkoChannel *> *) createChannel:(nonnull NSString *)channelId displayName:(nullable NSString *)displayName type:(EkoChannelCreateType)type metadata:(nonnull NSDictionary<NSString *, id> *)metadata users:(nonnull NSArray<NSString *> *)userIds;
Swift
func createChannel(_ channelId: String, displayName: String?, type: EkoChannelCreateType, metadata: [String : Any], users userIds: [String]) -> EkoObject<EkoChannel>
Parameters
channelId
A channel Identifier
displayName
The Channel display name (this can be changed later)
type
The channel type
metadata
Your custom metadata to associate with the channel
userIds
An array of user Ids
-
Create a channel Convenience method with the few required parameters: in this case an empty dictionary to metadata, and the channel displayName is not set at all (nil)
Declaration
Objective-C
- (nonnull EkoObject<EkoChannel *> *) createChannel:(nonnull NSString *)channelId type:(EkoChannelCreateType)type users:(nonnull NSArray<NSString *> *)userIds;
Swift
func createChannel(_ channelId: String, type: EkoChannelCreateType, users userIds: [String]) -> EkoObject<EkoChannel>
Parameters
channelId
A channel Identifier
type
The channel type
userIds
An array of user Ids
-
Deprecated
Start from 3.0 this no longer be supported in the long term, please use createChannel instead.
Joins a channel by channel Id, if you are already in this channel, it will fetch the existing channel
Declaration
Objective-C
- (nonnull EkoObject<EkoChannel *> *)joinChannel:(nonnull NSString *)channelId type:(EkoChannelType)type;
Swift
func joinChannel(_ channelId: String, type: EkoChannelType) -> EkoObject<EkoChannel>
Parameters
channelId
A valid Channel Id
Return Value
A Proxy Object for the channel
-
Gets an existing channel by channel Id
Declaration
Objective-C
- (nonnull EkoObject<EkoChannel *> *)getChannel:(nonnull NSString *)channelId;
Swift
func getChannel(_ channelId: String) -> EkoObject<EkoChannel>
-
Sets the metadata for the channel
Declaration
Objective-C
- (void)setMetadataForChannel:(nonnull NSString *)channelId data:(nullable NSDictionary<NSString *, id> *)data completion:(nullable EkoRequestCompletion)completion;
Swift
func setMetadataForChannel(_ channelId: String, data: [String : Any]?, completion: EkoRequestCompletion? = nil)
Parameters
channelId
A valid Channel Id
data
A dictionary containing metadata
-
Sets the display name for the channel
Declaration
Objective-C
- (void)setDisplayNameForChannel:(nonnull NSString *)channelId displayName:(nonnull NSString *)displayName completion:(nullable EkoRequestCompletion)completion;
Swift
func setDisplayNameForChannel(_ channelId: String, displayName: String, completion: EkoRequestCompletion? = nil)
Parameters
channelId
A valid Channel Id
displayName
a display name for the channel
-
Sets the tags for the given channel
Declaration
Objective-C
- (void)setTagsForChannel:(nonnull NSString *)channelId tags:(nullable NSArray<NSString *> *)tags completion:(nullable EkoRequestCompletion)completion;
Swift
func setTagsForChannel(_ channelId: String, tags: [String]?, completion: EkoRequestCompletion? = nil)
Parameters
channelId
A valid Channel Id
tags
An array of tags
-
Deprecated
Deprecated start from 3.0, this no longer be supported in the long term, please use channel collection with builder instead.
@abstract Returns a collection of all channels, filtered by the specific filter and tags
Note
A channel is matched when it contains ANY tag listed in includingTags, and contains NONE of the tags listed in excludingTags
Declaration
Objective-C
- (nonnull EkoCollection<EkoChannel *> *) channelsForFilter:(EkoChannelQueryFilter)filter includingTags:(nonnull NSArray<NSString *> *)includingTags excludingTags:(nonnull NSArray<NSString *> *)excludingTags;
Swift
func channels(for filter: EkoChannelQueryFilter, includingTags: [String], excludingTags: [String]) -> EkoCollection<EkoChannel>
Parameters
filter
Indicates whether we want channels where the user is member, not member, or both
includingTags
The list of required channel tags, pass an empty array to ignore this requirement
excludingTags
The list of tags required not to be set in the channels, pass an empty array to ignore this requirement
Return Value
Collection instance
-
Create a channel
Declaration
Objective-C
- (nonnull EkoObject<EkoChannel *> *) createChannel:(nonnull NSString *)channelId displayName:(nullable NSString *)displayName type:(EkoChannelCreateType)type metadata:(nonnull NSDictionary<NSString *, id> *)metadata tags:(nonnull NSArray<NSString *> *)tags users:(nonnull NSArray<NSString *> *)userIds;
Swift
func createChannel(_ channelId: String, displayName: String?, type: EkoChannelCreateType, metadata: [String : Any], tags: [String], users userIds: [String]) -> EkoObject<EkoChannel>
Parameters
channelId
A channel Identifier
displayName
The Channel display name (this can be changed later)
type
The channel type
metadata
Your custom metadata to associate with the channel
tags
Your custom tags to associate with the channel
userIds
An array of user Ids
-
Create a conversation channel
Declaration
Objective-C
- (nonnull EkoObject<EkoChannel *> *) createConversation:(nonnull NSString *)userId displayName:(nullable NSString *)displayName metadata:(nonnull NSDictionary<NSString *, id> *)metadata tags:(nonnull NSArray<NSString *> *)tags;
Swift
func createConversation(_ userId: String, displayName: String?, metadata: [String : Any], tags: [String]) -> EkoObject<EkoChannel>
Parameters
userId
An user Identifier that we want to chat with
displayName
The Channel display name (this can be changed later)
metadata
Your custom metadata to associate with the channel
tags
Your custom tags to associate with the channel
-
Create a new channel query builder in order to get specific channel types
Note
Hence client must specify the channel types with declarative ways in order get the correct designated builderDeclaration
Objective-C
- (nonnull EkoChannelQueryBuilder *)channelCollection;
Swift
func channelCollection() -> EkoChannelQueryBuilder
Return Value
ChannelQueryBuilder instance
-
@abstract Channel Level Push Notifications Management object.
Declaration
Objective-C
- (nonnull EkoChannelNotificationsManager *)notificationManagerForChannelId: (nonnull NSString *)channelId;
Swift
func notificationManager(forChannelId channelId: String) -> EkoChannelNotificationsManager
-
Search channels by the display name
Declaration
Objective-C
- (nonnull EkoCollection<EkoChannel *> *)searchChannel: (nonnull NSString *)displayName;
Swift
func searchChannel(_ displayName: String) -> EkoCollection<EkoChannel>
Parameters
displayName
The expected channel display name
Return Value
Collection of EkoChannel Live object
-
Get channels by the recommendation that we calculate
Declaration
Objective-C
- (nonnull EkoCollection<EkoChannel *> *)suggestedChannelCollection;
Swift
func suggestedChannelCollection() -> EkoCollection<EkoChannel>
Return Value
Collection of EkoChannel Live object base on recommendation
-
Unavailable
Block call of
init
andnew
because this object cannot be created directlyDeclaration
Objective-C
- (nonnull instancetype)init;