NXMConversation

@interface NXMConversation : NSObject

@property (readonly, nonatomic, nonnull) NSString *conversationId;
@property (readonly, nonatomic, nonnull) NSString *name;
@property (readonly, nonatomic, nullable) NSString *displayName;
@property (readonly, nonatomic) NSInteger lastEventId;
@property (readonly, nonatomic, nonnull) NSDate *creationDate;
@property (readonly, nonatomic, nullable) NXMMember *myMember;
@property (readonly, nonatomic, nullable) NSArray<NXMMember *> *otherMembers;
@property (nonatomic, weak, nullable) id <NXMConversationDelegate> delegate;
/**
 Join the current logged user as a member of the conversation

 @param completion
 A completion block with the new member of the conversation or an error object if an error occured
 */
- (void)joinWithCompletion:(void (^_Nullable)(NSError * _Nullable error, NXMMember * _Nullable member))completion;

/**
 Joins a user as a member of the conversation

 @param userId
 The id of the user to join
 
 @param completion
 A completion block with an error object if one occured, or the new member object if user joined
 */
- (void)joinMemberWithUserId:(nonnull NSString *)userId
                completion:(void (^_Nullable)(NSError * _Nullable error, NXMMember * _Nullable member))completion;


/**
 Current user's member leaves the conversation
 
 @param completion
 A completion block with an error object if one occured
 */
- (void)leaveWithCompletion:(void (^_Nullable)(NSError * _Nullable error))completion;


/**
 Kicks a member from participating in the conversation
 
 @param memberId
 The id of the member to kick
 
 @param completion
 A completion block with an error object if one occured
 */
- (void)kickMemberWithMemberId:(nonnull NSString *)memberId
                     completion:(void (^_Nullable)(NSError * _Nullable error))completion;


/**
 Sends a text message to the members of the conversation
 
 @param text
 The text to send
 
 @param completion
 A completion block with an error object if one occured
 */
- (void)sendText:(nonnull NSString *)text
     completion:(void (^_Nullable)(NSError * _Nullable error))completion;


/**
 Sends an attachment message to the members of the conversation
 
 @param attachmentType
 The type of the attachment following NXMAttachmentType enum
 
 @param name
 A name identifier of the attachment
 
 @param data
 The data of the attachment in a NSData representation
 
 @param completion
 A completion block with an error object if one occured
 */
- (void)sendAttachmentOfType:(NXMAttachmentType)attachmentType
                   WithName:(nonnull NSString *)name
                        data:(nonnull NSData *)data
                  completion:(void (^_Nullable)(NSError * _Nullable error))completion;

/**
 Sends an indication that the current user's member started typing
 
 @param completion
 A completion block with an error object if one occured
 */
- (void)sendStartTypingWithCompletion:(void (^_Nullable)(NSError * _Nullable error))completion;

/**
 Sends an indication that the current user's member stopped typing
 
 @param completion
 A completion block with an error object if one occured
 */
- (void)sendStopTypingWithCompletion:(void (^_Nullable)(NSError * _Nullable error))completion;


/**
 Get an instance of NXMConversationEventsController.
 
 
 @param eventTypes
 A NSSet of the types of events the controller should handle

 @param delegate
 An instance conforming to the NXMConversationEventsControllerDelegate protocol, used to get notifications about changes in the controller.
 
 @return a new instance of NXMConversationEventsController
 */
- (nonnull NXMConversationEventsController *)eventsControllerWithTypes:(nonnull NSSet<NSNumber *> *)eventTypes
                                                          andDelegate:(id <NXMConversationEventsControllerDelegate>_Nullable)delegate;
@end

Undocumented

  • Undocumented

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) NSString *conversationId

    Swift

    var conversationId: UnsafeMutablePointer<Int32> { get }
  • Undocumented

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) NSString *name

    Swift

    var name: UnsafeMutablePointer<Int32> { get }
  • Undocumented

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NSString *displayName

    Swift

    var displayName: UnsafeMutablePointer<Int32>? { get }
  • Undocumented

    Declaration

    Objective-C

    @property (readonly, nonatomic) NSInteger lastEventId

    Swift

    var lastEventId: Int32 { get }
  • Undocumented

    Declaration

    Objective-C

    @property (readonly, nonatomic, nonnull) NSDate *creationDate

    Swift

    var creationDate: UnsafeMutablePointer<Int32> { get }
  • Undocumented

    Declaration

    Objective-C

    @property (readonly, nonatomic, nullable) NXMMember *myMember

    Swift

    var myMember: NXMMember? { get }
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id <NXMConversationDelegate> delegate

    Swift

    weak var delegate: NXMConversationDelegate? { get set }
  • Join the current logged user as a member of the conversation

    Declaration

    Objective-C

    - (void)joinWithCompletion:(void (^_Nullable)(int *_Nullable,
                                                  NXMMember *_Nullable))completion;

    Swift

    func join(completion: ((UnsafeMutablePointer<Int32>?, NXMMember?) -> Void)? = nil)

    Parameters

    completion

    A completion block with the new member of the conversation or an error object if an error occured

  • Joins a user as a member of the conversation

    Declaration

    Objective-C

    - (void)joinMemberWithUserId:(id)userId
                      completion:
                          (void (^_Nullable)(int *_Nullable,
                                             NXMMember *_Nullable))completion;

    Swift

    func joinMember(withUserId userId: Any!, completion: ((UnsafeMutablePointer<Int32>?, NXMMember?) -> Void)? = nil)

    Parameters

    userId

    The id of the user to join

    completion

    A completion block with an error object if one occured, or the new member object if user joined

  • Current user’s member leaves the conversation

    Declaration

    Objective-C

    - (void)leaveWithCompletion:(void (^_Nullable)(int *_Nullable))completion;

    Swift

    func leave(completion: ((UnsafeMutablePointer<Int32>?) -> Void)? = nil)

    Parameters

    completion

    A completion block with an error object if one occured

  • Kicks a member from participating in the conversation

    Declaration

    Objective-C

    - (void)kickMemberWithMemberId:(id)memberId
                        completion:(void (^_Nullable)(int *_Nullable))completion;

    Swift

    func kickMember(withMemberId memberId: Any!, completion: ((UnsafeMutablePointer<Int32>?) -> Void)? = nil)

    Parameters

    memberId

    The id of the member to kick

    completion

    A completion block with an error object if one occured

  • Sends a text message to the members of the conversation

    Declaration

    Objective-C

    - (void)sendText:(id)text
          completion:(void (^_Nullable)(int *_Nullable))completion;

    Swift

    func sendText(_ text: Any!, completion: ((UnsafeMutablePointer<Int32>?) -> Void)? = nil)

    Parameters

    text

    The text to send

    completion

    A completion block with an error object if one occured

  • Sends an attachment message to the members of the conversation

    Declaration

    Objective-C

    - (void)sendAttachmentOfType:(id)attachmentType
                        WithName:(id)name
                            data:(id)data
                      completion:(void (^_Nullable)(int *_Nullable))completion;

    Swift

    func sendAttachment(ofType attachmentType: Any!, withName name: Any!, data: Any!, completion: ((UnsafeMutablePointer<Int32>?) -> Void)? = nil)

    Parameters

    attachmentType

    The type of the attachment following NXMAttachmentType enum

    name

    A name identifier of the attachment

    data

    The data of the attachment in a NSData representation

    completion

    A completion block with an error object if one occured

  • Sends an indication that the current user’s member started typing

    Declaration

    Objective-C

    - (void)sendStartTypingWithCompletion:
        (void (^_Nullable)(int *_Nullable))completion;

    Swift

    func sendStartTyping(completion: ((UnsafeMutablePointer<Int32>?) -> Void)? = nil)

    Parameters

    completion

    A completion block with an error object if one occured

  • Sends an indication that the current user’s member stopped typing

    Declaration

    Objective-C

    - (void)sendStopTypingWithCompletion:
        (void (^_Nullable)(int *_Nullable))completion;

    Swift

    func sendStopTyping(completion: ((UnsafeMutablePointer<Int32>?) -> Void)? = nil)

    Parameters

    completion

    A completion block with an error object if one occured

  • Get an instance of NXMConversationEventsController.

    Declaration

    Objective-C

    - (nonnull NXMConversationEventsController *)
    eventsControllerWithTypes:(id)eventTypes
                  andDelegate:
                      (id<NXMConversationEventsControllerDelegate> _Nullable)
                          delegate;

    Swift

    func eventsController(withTypes eventTypes: Any!, andDelegate delegate: NXMConversationEventsControllerDelegate?) -> NXMConversationEventsController

    Parameters

    eventTypes

    A NSSet of the types of events the controller should handle

    delegate

    An instance conforming to the NXMConversationEventsControllerDelegate protocol, used to get notifications about changes in the controller.

    Return Value

    a new instance of NXMConversationEventsController