Compartilhar via


Class SPXConversation

Declaration

@class SPXConversation : NSObject;

Description

Performs conversation management including add and remove participants.

Added in version 1.13.0.

Methods

init:

Initializes a new instance of conversation using the specified speech configuration.

- (instancetype _Nullable)init:(SPXSpeechConfiguration * _Nonnull)speechConfiguration

Parameters

  • speechConfiguration - speech configuration.

Returns

a conversation instance.

init:error:

Initializes a new instance of conversation using the specified speech configuration.

- (instancetype _Nullable)init:(SPXSpeechConfiguration * _Nonnull)speechConfiguration
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • speechConfiguration - speech configuration.
  • outError - error information.

Returns

a conversation instance.

init:conversationId:

Initializes a new instance of conversation using the specified speech configuration and conversation id.

- (instancetype _Nullable)init:(SPXSpeechConfiguration * _Nonnull)speechConfiguration
    conversationId:(NSString * _Nonnull)conversationId

Parameters

  • speechConfiguration - speech configuration.
  • conversationId - a unqiue identification of your conversation.

Returns

a conversation instance.

init:conversationId:error:

Initializes a new instance of conversation using the specified speech configuration and conversation id.

- (instancetype _Nullable)init:(SPXSpeechConfiguration * _Nonnull)speechConfiguration
    conversationId:(NSString * _Nonnull)conversationId
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • speechConfiguration - speech configuration.
  • conversationId - a unqiue identification of your conversation.
  • outError - error information.

Returns

a conversation instance.

startConversationAsync:

Starts a conversation, and provides asynchronous callback with the information is conversation started successfully or not.

- (void)startConversationAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler

Parameters

  • completedHandler - the block function to be called when async operation has been completed.

startConversationAsync:error:

Starts a conversation, and provides asynchronous callback with the information is conversation started successfully or not.

- (BOOL)startConversationAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • outError - error information.

endConversationAsync:

Ends a conversation, and provides asynchronous callback with the information is conversation ended successfully or not.

- (void)endConversationAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler

Parameters

  • completedHandler - the block function to be called when async operation has been completed.

endConversationAsync:error:

Ends a conversation, and provides asynchronous callback with the information is conversation ended successfully or not.

- (BOOL)endConversationAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • outError - error information.

deleteConversationAsync:

Deletes a conversation, and provides asynchronous callback with the information is conversation deletion completed. After deleted, no one will be able to join the conversation.

- (void)deleteConversationAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler

Parameters

  • completedHandler - the block function to be called when async operation has been completed.

deleteConversationAsync:error:

Deletes a conversation, and provides asynchronous callback with the information is conversation deletion completed. After deleted, no one will be able to join the conversation.

- (BOOL)deleteConversationAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • outError - error information.

lockConversationAsync:

Locks a conversation, and provides asynchronous callback with the information is conversation locking completed. After locked, new participants are prevented from joining the conversation.

- (void)lockConversationAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler

Parameters

  • completedHandler - the block function to be called when async operation has been completed.

lockConversationAsync:error:

Locks a conversation, and provides asynchronous callback with the information is conversation locking completed. After locked, new participants are prevented from joining the conversation.

- (BOOL)lockConversationAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • outError - error information.

unlockConversationAsync:

Unlocks a conversation, and provides asynchronous callback with the information is conversation unlocking completed.

- (void)unlockConversationAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler

Parameters

  • completedHandler - the block function to be called when async operation has been completed.

unlockConversationAsync:error:

Unlocks a conversation, and provides asynchronous callback with the information is conversation unlocking completed.

- (BOOL)unlockConversationAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • outError - error information.

muteAllParticipantsAsync:

Mute all other participants in the conversation. After this no other participants will have their speech recognitions broadcast, nor be able to send text messages.

- (void)muteAllParticipantsAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler

Parameters

  • completedHandler - the block function to be called when async operation has been completed.

muteAllParticipantsAsync:error:

Mute all other participants in the conversation. After this no other participants will have their speech recognitions broadcast, nor be able to send text messages.

- (BOOL)muteAllParticipantsAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • outError - error information.

unmuteAllParticipantsAsync:

Unmute all other participants in the conversation.

- (void)unmuteAllParticipantsAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler

Parameters

  • completedHandler - the block function to be called when async operation has been completed.

unmuteAllParticipantsAsync:error:

Unmute all other participants in the conversation.

- (BOOL)unmuteAllParticipantsAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • outError - error information.

muteParticipantAsync:userId:

Mute participant with a given userId in the conversation.

- (void)muteParticipantAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    userId:(NSString * _Nonnull)userId

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • userId - A user identifier.

muteParticipantAsync:userId:error:

Mute participant with a given userId in the conversation.

- (BOOL)muteParticipantAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    userId:(NSString * _Nonnull)userId error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • userId - A user identifier.
  • outError - error information.

unmuteParticipantAsync:userId:

Unmute participant with a given userId in the conversation.

- (void)unmuteParticipantAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    userId:(NSString * _Nonnull)userId

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • userId - A user identifier.

unmuteParticipantAsync:userId:error:

Unmute participant with a given userId in the conversation.

- (BOOL)unmuteParticipantAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    userId:(NSString * _Nonnull)userId error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • userId - A user identifier.
  • outError - error information.

addParticipantAsync:userId:

Adds a participant from a conversation using a user id.

- (void)addParticipantAsync:(void (^ _Nonnull)(SPXParticipant * _Nullable, NSError * _Nullable))completedHandler
    userId:(NSString * _Nonnull)userId

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • userId - A user identifier.

addParticipantAsync:userId:error:

Adds a participant from a conversation using a user id.

- (BOOL)addParticipantAsync:(void (^ _Nonnull)(SPXParticipant * _Nullable, NSError * _Nullable))completedHandler
    userId:(NSString * _Nonnull)userId error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • userId - A user identifier.
  • outError - error information.

addParticipantAsync:participant:

Adds a participant from a conversation using a Participant object.

- (void)addParticipantAsync:(void (^ _Nonnull)(SPXParticipant * _Nullable, NSError * _Nullable))completedHandler
    participant:(SPXParticipant * _Nonnull)participant

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • participant - A Participant instance.

addParticipantAsync:participant:error:

Adds a participant from a conversation using a Participant object.

- (BOOL)addParticipantAsync:(void (^ _Nonnull)(SPXParticipant * _Nullable, NSError * _Nullable))completedHandler
    participant:(SPXParticipant * _Nonnull)participant
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • participant - A Participant instance.
  • outError - error information.

addParticipantAsync:user:

Adds a participant from a conversation using a User object.

- (void)addParticipantAsync:(void (^ _Nonnull)(SPXUser * _Nullable, NSError * _Nullable))completedHandler
    user:(SPXUser * _Nonnull)user

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • user - A User instance.

addParticipantAsync:user:error:

Adds a participant from a conversation using a User object.

- (BOOL)addParticipantAsync:(void (^ _Nonnull)(SPXUser * _Nullable, NSError * _Nullable))completedHandler
    user:(SPXUser * _Nonnull)user error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • user - A User instance.
  • outError - error information.

removeParticipantAsync:userId:

Remove a participant from a conversation using a user id.

- (void)removeParticipantAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    userId:(NSString * _Nonnull)userId

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • userId - A user identifier.

removeParticipantAsync:userId:error:

Remove a participant from a conversation using a user id.

- (BOOL)removeParticipantAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    userId:(NSString * _Nonnull)userId error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • userId - A user identifier.
  • outError - error information.

removeParticipantAsync:participant:

Remove a participant from a conversation using a Participant object.

- (void)removeParticipantAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    participant:(SPXParticipant * _Nonnull)participant

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • participant - A Participant instance.

removeParticipantAsync:participant:error:

Remove a participant from a conversation using a Participant object.

- (BOOL)removeParticipantAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    participant:(SPXParticipant * _Nonnull)participant
    error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • participant - A Participant instance.
  • outError - error information.

removeParticipantAsync:user:

Remove a participant from a conversation using a User object.

- (void)removeParticipantAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    user:(SPXUser * _Nonnull)user

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • user - A User instance.

removeParticipantAsync:user:error:

Remove a participant from a conversation using a User object.

- (BOOL)removeParticipantAsync:(void (^ _Nonnull)(BOOL, NSError * _Nullable))completedHandler
    user:(SPXUser * _Nonnull)user error:(NSError * _Nullable * _Nullable)outError

Parameters

  • completedHandler - the block function to be called when async operation has been completed.
  • user - A User instance.
  • outError - error information.

Properties

properties

@property (readonly, atomic) id<SPXPropertyCollection> _Nullable properties;

The collection of properties and their values defined for this SPXConversation.

conversationId

@property (readwrite, copy, nonatomic) NSString * _Nullable conversationId;

The unique identifier for the conversation.

authorizationToken

@property (readwrite, copy, nonatomic) NSString * _Nullable authorizationToken;

The authorization token used to communicate with the service. Note: The caller needs to ensure that the authorization token is valid. Before the authorization token expires, the caller needs to refresh it by calling this setter with a new valid token. Otherwise, the recognizer will encounter errors during recognition.