Channel Member Data

Member Specific Data

You can set member specific information.

  • You can store data in memberInfo and privateData fields in the form of a map.

  • privateTag field can be used as a search filter when retrieving list of channels.

  • privateData is only visible to the current user while memberInfo is publicly visible to anyone.

  • You can enter up to 5 key-value pairs in memberInfo and privateData fields. The maximum size of key is 128 characters and the maximum size of value is 1024 characters. Both key and value must be strings.

// update memberInfo
[[TalkPlus sharedInstance] updateChannel:tpChannel 
    memberInfo:dict 
    success:^(TPMember *tpMember) {
    
} failure:^(int errorCode, NSError *error) {
    
}];

// update member Private Data
[[TalkPlus sharedInstance] updateChannel:TPChannel 
    privateData:privateData 
    success:^(TPChannel *tpChannel) {
    
} failure:^(int errorCode, NSError *error) {
    
}];

// get Private Data
[tpChannel getPrivateData];

// update Private Tag
[[TalkPlus sharedInstance] updateChannel:TPChannel 
    privateTag:privateTag 
    success:^(TPChannel *tpChannel) {
    
} failure:^(int errorCode, NSError *error) {
    
}];

// get Private Tag
[tpChannel getPrivateTag];

Channel Private Tag

You can put a private tag on channel to help with channel search.

  • privateTag is visible only to current user and is used for filtering channels (ex. "my_favorite_channels")

  • TPChannelQueryParams class is available starting from TalkPlus iOS SDK v0.5.7.

// put a private tag on channel
[TalkPlus sharedInstance] updateChannel:tpChannel 
    privateTag: @"myPrivateTag" 
    success:^(TPChannel *tpChannel) {
  // SUCCESS
} failure:^(int errorCode, NSError *error) {
  // FAILURE
}];

// get channels that match the private tag
TPChannelQueryParams *params = [[TPChannelQueryParams alloc] init];
params.privateTag = @"myPrivateTag";
    
[[TalkPlus sharedInstance] searchChannels:params 
    success:^(NSArray<TPChannel *> *tpChannels, BOOL hasNext) {
    // SUCCESS
    // If 'hasNext' is YES, call this method with the last object in 'tpChannels'.
} failure:^(int errorCode, NSError *error) {
    // FAILURE
}];

Last updated