Agora RTC Objective-C API Reference  Refactor
Instance Methods
AgoraRtmLock Class Reference

Inherits <NSObject>.

Instance Methods

(void) - setLock:channelType:lockName:ttl:completion:
 
(void) - removeLock:channelType:lockName:completion:
 
(void) - acquireLock:channelType:lockName:retry:completion:
 
(void) - releaseLock:channelType:lockName:completion:
 
(void) - revokeLock:channelType:lockName:userId:completion:
 
(void) - getLocks:channelType:completion:
 

Method Documentation

◆ NS_UNAVAILABLE

- (instancetype _Nullable) NS_UNAVAILABLE

◆ setLock:channelType:lockName:ttl:completion:

- (void) setLock: (NSString *_Nonnull)  channelName
channelType: (AgoraRtmChannelType channelType
lockName: (NSString *_Nonnull)  lockName
ttl: (int)  ttl
completion: (AgoraRtmOperationBlock _Nullable)  completionBlock 

sets a lock

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
lockNameThe name of the lock.
ttlThe lock ttl.
completionBlockThe 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.

◆ removeLock:channelType:lockName:completion:

- (void) removeLock: (NSString *_Nonnull)  channelName
channelType: (AgoraRtmChannelType channelType
lockName: (NSString *_Nonnull)  lockName
completion: (AgoraRtmOperationBlock _Nullable)  completionBlock 

removes a lock

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
lockNameThe name of the lock.
completionBlockThe 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.

◆ acquireLock:channelType:lockName:retry:completion:

- (void) acquireLock: (NSString *_Nonnull)  channelName
channelType: (AgoraRtmChannelType channelType
lockName: (NSString *_Nonnull)  lockName
retry: (BOOL)  retry
completion: (AgoraRtmOperationBlock _Nullable)  completionBlock 

acquires a lock

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
lockNameThe name of the lock.
retryWhether to automatic retry when acquires lock failed
completionBlockThe 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.

◆ releaseLock:channelType:lockName:completion:

- (void) releaseLock: (NSString *_Nonnull)  channelName
channelType: (AgoraRtmChannelType channelType
lockName: (NSString *_Nonnull)  lockName
completion: (AgoraRtmOperationBlock _Nullable)  completionBlock 

releases a lock

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
lockNameThe name of the lock.
completionBlockThe 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.

◆ revokeLock:channelType:lockName:userId:completion:

- (void) revokeLock: (NSString *_Nonnull)  channelName
channelType: (AgoraRtmChannelType channelType
lockName: (NSString *_Nonnull)  lockName
userId: (NSString *_Nonnull)  userId
completion: (AgoraRtmOperationBlock _Nullable)  completionBlock 

disables a lock

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
lockNameThe name of the lock.
ownerThe lock owner.
completionBlockThe 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.

◆ getLocks:channelType:completion:

- (void) getLocks: (NSString *_Nonnull)  channelName
channelType: (AgoraRtmChannelType channelType
completion: (AgoraRtmGetLocksBlock _Nullable)  completionBlock 

gets locks in the channel

Parameters
channelNameThe name of the channel.
channelTypeThe type of the channel.
completionBlockThe 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.