File tree Expand file tree Collapse file tree
Assets/Plugins/StreamChat/Samples Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -294,8 +294,30 @@ private class ClanData
294294 /// </summary>
295295 public async Task FullUpdate ( )
296296 {
297- //StreamTodo: IMPLEMENT channel full update
298- await Task . CompletedTask ;
297+ var channel = await Client . GetOrCreateChannelWithIdAsync ( ChannelType . Messaging , channelId : "my-channel-id" ) ;
298+
299+ var updateRequest = new StreamUpdateOverwriteChannelRequest
300+ {
301+ Name = "New name" ,
302+ CustomData = new StreamCustomDataRequest
303+ {
304+ { "my-custom-int" , 12 } ,
305+ { "my-custom-array" , new string [ ] { "one" , "two" } }
306+ }
307+ } ;
308+
309+ // This request will have all channel data removed except what is being passed in the request
310+ await channel . UpdateOverwriteAsync ( updateRequest ) ;
311+
312+ // You can also pass an instance of channel to the request constructor to have all of the date copied over
313+ // This way you alter only the fields you wish to change
314+ var updateRequest2 = new StreamUpdateOverwriteChannelRequest ( channel )
315+ {
316+ Name = "Bran new name"
317+ } ;
318+
319+ // This will update only the name because all other data was copied over
320+ await channel . UpdateOverwriteAsync ( updateRequest2 ) ;
299321 }
300322
301323 #endregion
You can’t perform that action at this time.
0 commit comments