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 member info
TalkPlusApi.UpdateChannelMemberInfo(tpChannel, 
    memberInfo, 
    (TPMember tpMember) => {
  // SUCCESS
}, (int statusCode, Exception e) => {
  // FAILURE
});

// update private data
TalkPlusApi.UpdateChannelPrivateData(tpChannel, 
    privateData, 
    (TPChannel tpChannel) => {
  // SUCCESS
}, (int statusCode, Exception e) => {
  // FAILURE
});

// get private data
tpChannel.GetPrivateData();

// update private tag
TalkPlusApi.UpdateChannelPrivateTag(tpChannel, 
    privateTag, 
    (TPChannel tpChannel) => {
  // SUCCESS    
}, (int statusCode, Exception e) => {
  // FAILURE
});

// 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 Unity SDK v0.5.7.

// update private tag
TalkPlusApi.UpdateChannelPrivateTag(tpChannel, 
  "myPrivateTag", 
  (TPChannel tpChannel) => {
  // SUCCESS
},(int statusCode, Exception e) => {
  // FAILURE
});

// get channels that match the private tag
var queryParams = new TPChannelQueryParams();
queryParams.privateTag = "myPrivateTag";

TalkPlusApi.SearchChannels(queryParams, 
   (List<TPChannel> tpChannels, bool hasNext) => {
   // SUCCESS
}, (int statusCode, Exception e) => {
   // FAILURE
});

Last updated