Agora RTC Objective-C API Reference Refactor

Instance Methods
AgoraRtmStorage Class Reference

Inherits <NSObject>.

## Instance Methods
(void) | - setChannelMetadata:channelType:data:options:lock:completion:
(void) | - updateChannelMetadata:channelType:data:options:lock:completion:
(void) | - removeChannelMetadata:channelType:data:options:lock:completion:
(void) | - getChannelMetadata:channelType:completion:
(void) | - setUserMetadata:data:options:completion:
(void) | - updateUserMetadata:data:options:completion:
(void) | - removeUserMetadata:data:options:completion:
(void) | - getUserMetadata:completion:
(void) | - subscribeUserMetadata:completion:
(void) | - unsubscribeUserMetadata:completion:

## Method Documentation

## ◆ NS_UNAVAILABLE

- (instancetype _Nullable) NS_UNAVAILABLE |  |  |

## ◆ setChannelMetadata:channelType:data:options:lock:completion:

- (void) setChannelMetadata: |  | (NSString *_Nonnull) | channelName
channelType: |  | (AgoraRtmChannelType) | channelType
data: |  | (AgoraRtmMetadata *_Nonnull) | data
options: |  | (AgoraRtmMetadataOptions *_Nullable) | options
lock: |  | (NSString *_Nullable) | lock
completion: |  | (AgoraRtmOperationBlock _Nullable) | completionBlock

Set the metadata of a specified channel.

Parameters

  channelName | The name of the channel.
  channelType | Which channel type, AgoraRtmChannelTypeStream or AgoraRtmChannelTypeMessage.
  data | Metadata data.
  options | The options of operate metadata.
  lock | lock for operate channel metadata.
  completionBlock | The operation result will be notified by completionBlock, if operation success，will given a not nil response and nil errorInfo，if operation failed，will given a nil response and not nil errorInfo.

## ◆ updateChannelMetadata:channelType:data:options:lock:completion:

- (void) updateChannelMetadata: |  | (NSString *_Nonnull) | channelName
channelType: |  | (AgoraRtmChannelType) | channelType
data: |  | (AgoraRtmMetadata *_Nonnull) | data
options: |  | (AgoraRtmMetadataOptions *_Nullable) | options
lock: |  | (NSString *_Nullable) | lock
completion: |  | (AgoraRtmOperationBlock _Nullable) | completionBlock

Update the metadata of a specified channel.

Parameters

  channelName | The channel Name of the specified channel.
  channelType | Which channel type, AgoraRtmChannelTypeStream or AgoraRtmChannelTypeMessage.
  data | Metadata data.
  options | The options of operate metadata.
  lock | lock for operate channel metadata.
  completionBlock | The operation result will be notified by completionBlock, if operation success，will given a not nil response and nil errorInfo，if operation failed，will given a nil response and not nil errorInfo.

## ◆ removeChannelMetadata:channelType:data:options:lock:completion:

- (void) removeChannelMetadata: |  | (NSString *_Nonnull) | channelName
channelType: |  | (AgoraRtmChannelType) | channelType
data: |  | (AgoraRtmMetadata *_Nonnull) | data
options: |  | (AgoraRtmMetadataOptions *_Nullable) | options
lock: |  | (NSString *_Nullable) | lock
completion: |  | (AgoraRtmOperationBlock _Nullable) | completionBlock

Remove the metadata of a specified channel.

Parameters

  channelName | The channel Name of the specified channel.
  channelType | Which channel type, AgoraRtmChannelTypeStream or AgoraRtmChannelTypeMessage.
  data | Metadata data.
  options | The options of operate metadata.
  lock | lock for operate channel metadata.
  completionBlock | The operation result will be notified by completionBlock, if operation success，will given a not nil response and nil errorInfo，if operation failed，will given a nil response and not nil errorInfo.

## ◆ getChannelMetadata:channelType:completion:

- (void) getChannelMetadata: |  | (NSString *_Nonnull) | channelName
channelType: |  | (AgoraRtmChannelType) | channelType
completion: |  | (AgoraRtmGetMetadataBlock _Nullable) | completionBlock

Get the metadata of a specified channel.

Parameters

  channelName | The channel Name of the specified channel.
  channelType | Which channel type, AgoraRtmChannelTypeStream or AgoraRtmChannelTypeMessage.
  completionBlock | The operation result will be notified by completionBlock, if operation success，will given a not nil response and nil errorInfo，if operation failed，will given a nil response and not nil errorInfo.

## ◆ setUserMetadata:data:options:completion:

- (void) setUserMetadata: |  | (NSString *_Nonnull) | userId
data: |  | (AgoraRtmMetadata *_Nonnull) | data
options: |  | (AgoraRtmMetadataOptions *_Nullable) | options
completion: |  | (AgoraRtmOperationBlock _Nullable) | completionBlock

Set the metadata of a specified user.

Parameters

  userId | The user ID of the specified user.
  data | Metadata data.
  options | The options of operate metadata.
  completionBlock | The operation result will be notified by completionBlock, if operation success，will given a not nil response and nil errorInfo，if operation failed，will given a nil response and not nil errorInfo.

## ◆ updateUserMetadata:data:options:completion:

- (void) updateUserMetadata: |  | (NSString *_Nonnull) | userId
data: |  | (AgoraRtmMetadata *_Nonnull) | data
options: |  | (AgoraRtmMetadataOptions *_Nullable) | options
completion: |  | (AgoraRtmOperationBlock _Nullable) | completionBlock

Update the metadata of a specified user.

Parameters

  userId | The user ID of the specified user.
  data | Metadata data.
  options | The options of operate metadata.
  completionBlock | The operation result will be notified by completionBlock, if operation success，will given a not nil response and nil errorInfo，if operation failed，will given a nil response and not nil errorInfo.

## ◆ removeUserMetadata:data:options:completion:

- (void) removeUserMetadata: |  | (NSString *_Nonnull) | userId
data: |  | (AgoraRtmMetadata *_Nonnull) | data
options: |  | (AgoraRtmMetadataOptions *_Nullable) | options
completion: |  | (AgoraRtmOperationBlock _Nullable) | completionBlock

Remove the metadata of a specified user.

Parameters

  userId | The user ID of the specified user.
  data | Metadata data.
  options | The options of operate metadata.
  completionBlock | The operation result will be notified by completionBlock, if operation success，will given a not nil response and nil errorInfo，if operation failed，will given a nil response and not nil errorInfo.

## ◆ getUserMetadata:completion:

- (void) getUserMetadata: |  | (NSString *_Nonnull) | userId
completion: |  | (AgoraRtmGetMetadataBlock _Nullable) | completionBlock

Get the metadata of a specified user.

Parameters

  userId | The user ID of the specified user.
  completionBlock | The operation result will be notified by completionBlock, if operation success，will given a not nil response and nil errorInfo，if operation failed，will given a nil response and not nil errorInfo.

## ◆ subscribeUserMetadata:completion:

- (void) subscribeUserMetadata: |  | (NSString *_Nonnull) | userId
completion: |  | (AgoraRtmOperationBlock _Nullable) | completionBlock

Subscribe the metadata update event of a specified user.

Parameters

  userId | The user ID of the specified user.
  completionBlock | The operation result will be notified by completionBlock, if operation success，will given a not nil response and nil errorInfo，if operation failed，will given a nil response and not nil errorInfo.

## ◆ unsubscribeUserMetadata:completion:

- (void) unsubscribeUserMetadata: |  | (NSString *_Nonnull) | userId
completion: |  | (AgoraRtmOperationBlock _Nullable) | completionBlock

unsubscribe the metadata update event of a specified user.

Parameters

  userId | The user ID of the specified user.
  completionBlock | The operation result will be notified by completionBlock, if operation success，will given a not nil response and nil errorInfo，if operation failed，will given a nil response and not nil errorInfo.