Classes

The following classes are available globally.

  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMConversationEventsController : NSObject
    
    @property (nonatomic,weak, nullable) id <NXMConversationEventsControllerDelegate> delegate;
    @property (nonatomic,strong,readonly, nonnull) NSArray<NXMEvent*>*  events;
    
    -(void)loadEarlierEventsWithMaxAmount:(NSUInteger)maxAmount completion:(void (^_Nullable)(NSError * _Nullable error))completion;
    @end

    Swift

    class NXMConversationEventsController
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMMember : NSObject
    @property (nonatomic, strong) NSString *conversationId;
    @property (nonatomic, strong) NSString *memberId;
    @property (nonatomic, strong) NSString *joinDate;
    @property (nonatomic, strong) NSString *inviteDate;
    @property (nonatomic, strong) NSString *leftDate;
    @property (nonatomic, strong) NXMUser *user;
    @property (nonatomic) NXMMemberState state;
    
    - (instancetype)initWithMemberId:(NSString *)memberId
                      conversationId:(NSString *)conversationId
                              user:(NXMUser *)user
                               state:(NXMMemberState)state;
    
    -(instancetype)initWithMemberEvent:(NXMMemberEvent *)memberEvent;
    @end

    Swift

    class NXMMember
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMMediaActionEvent : NXMEvent
    @property (nonatomic, strong, nonnull) NSString *toMemberId;
    @property (nonatomic) NXMMediaType mediaType;
    @property (nonatomic) NXMMediaActionType actionType;
    
    @end

    Swift

    class NXMMediaActionEvent : NXMEvent
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMMediaSettings : NSObject
    @property bool isEnabled;
    @property bool isSuspended;
    
    - (instancetype)initWithEnabled:(BOOL)enabled suspend:(BOOL)suspend;
    @end

    Swift

    class NXMMediaSettings
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMRtcAnswerEvent : NSObject
    
    @property (nonatomic, strong, nonnull) NSString *conversationId;
    @property (nonatomic, strong, nonnull) NSString *rtcId;
    @property (nonatomic, strong, nonnull) NSString *sdp;
    @property (nonatomic, strong, nonnull) NSString *sessionId;
    @property (nonatomic, strong, nonnull) NSDate *timestamp;
    
    @end

    Swift

    class NXMRtcAnswerEvent
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMSipEvent : NXMEvent
    @property (nonatomic, strong, nonnull) NSString *phoneNumber;
    @property (nonatomic, strong, nonnull) NSString *applicationId;
    @property (nonatomic) NXMSipEventType sipType;
    @end

    Swift

    class NXMSipEvent : NXMEvent
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMMemberEvent : NXMEvent
    
    @property (nonatomic, strong, nonnull) NSString *memberId;
    @property (nonatomic) NXMMemberState state;
    @property (nonatomic, strong, nonnull) NXMUser *user;
    @property (nonatomic, strong, nonnull) NSString *phoneNumber;
    @property (nonatomic, strong, nullable) NXMMediaSettings *media;
    @property (nonatomic) NXMChannelType channelType;
    @property (nonatomic, strong, nullable) NSString *channelData;
    @property (nonatomic, strong, nullable) NSString *knockingId;
    
    @end

    Swift

    class NXMMemberEvent : NXMEvent
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMImageInfo : NSObject
    @property (nonatomic, strong, nonnull) NSString *imageId;
    @property (nonatomic, strong, nonnull) NSURL *url;
    @property NSInteger size;
    @property NXMImageType type;
    
    - (nullable instancetype)initWithId:(nonnull NSString *)imageId size:(NSInteger)size url:(nonnull NSURL *)url type:(NXMImageType)type;
    
    @end

    Swift

    class NXMImageInfo
  • Undocumented

    Declaration

    Objective-C

    @interface NXMMessageEvent : NXMEvent
    @property (nonatomic, strong,nonnull) NSMutableDictionary<NSNumber *,NSMutableDictionary<NSString *, NSDate *> *> *state;
    @end

    Swift

    class NXMMessageEvent : NXMEvent
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMMessageStatusEvent : NXMEvent
    @property NSInteger eventId;
    @property (nonatomic) NXMMessageStatusType status;
    @end

    Swift

    class NXMMessageStatusEvent : NXMEvent
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMEvent : NSObject
    
    @property (nonatomic, strong, nonnull) NSString *conversationId;
    @property (nonatomic, strong, nonnull) NSString *fromMemberId;
    @property (nonatomic, strong, nonnull) NSDate *creationDate;
    @property (nonatomic, strong, nullable) NSDate *deletionDate;
    @property NXMEventType type;
    @property NSInteger sequenceId;
    
    - (nullable instancetype)initWithConversationId:(nonnull NSString *)conversationId
                                               type:(NXMEventType)type
                                       fromMemberId:(nullable)memberId
                                         sequenceId:(NSInteger)sequenceId;
    
    - (nullable instancetype)initWithConversationId:(nonnull NSString *)conversationId
                                sequenceId:(NSInteger)sequenceId
                              fromMemberId:(nullable NSString *)fromMemberId
                              creationDate:(nullable NSDate *)creationDate
                                      type:(NXMEventType)type;
    
    @end

    Swift

    class NXMEvent
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMUser : NSObject
    
    @property NSString * _Nonnull userId;
    @property NSString * _Nonnull name;
    @property NSString * _Nullable displayName;
    
    - (instancetype _Nullable)initWithId:(NSString * _Nonnull)uuid name:(NSString * _Nonnull)name;
    - (instancetype _Nullable)initWithId:(NSString * _Nonnull)uuid name:(NSString * _Nonnull)name displayName:(NSString * _Nullable)displayName;
    
    @end

    Swift

    class NXMUser
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMCall : NSObject
    
    @property (nonatomic, readonly, nonnull) NSMutableArray<NXMCallMember *> *otherCallMembers;
    @property (nonatomic, readonly, nonnull) NXMCallMember *myCallMember;
    @property (nonatomic, readonly) NXMCallStatus status;
    @property (nonatomic, readonly, nonnull) NXMConversation* conversation;
    
    - (void)setDelegate:(nonnull id<NXMCallDelegate>)delegate;
    
    - (void)answer:(nonnull id<NXMCallDelegate>)delegate completionHandler:(NXMErrorCallback _Nullable)completionHandler;
    - (void)reject:(NXMErrorCallback _Nullable)completionHandler;
    
    - (void)addCallMemberWithUserId:(NSString *)userId completionHandler:(NXMErrorCallback _Nullable)completionHandler;
    - (void)addCallMemberWithNumber:(NSString *)number completionHandler:(NXMErrorCallback _Nullable)completionHandler;
    
    @end

    Swift

    class NXMCall
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMCallMember : NSObject
    
    @property (nonatomic, readonly, nonnull) NSString *callId;
    @property (nonatomic, readonly, nonnull) NSString *memberId;
    @property (nonatomic, readonly, nonnull) NXMUser *user;
    @property (nonatomic, readonly) BOOL isMuted;
    @property (nonatomic, readonly) NXMCallMemberStatus status;
    @property (nonatomic, readonly, nullable) NSString *metaInfo;
    
    - (void)hangup;
    - (void)hold:(BOOL)isHold;
    - (void)mute:(BOOL)isMute;
    - (void)earmuff:(BOOL)isEarmuff;
    
    @end

    Swift

    class NXMCallMember
  • Undocumented

    See more

    Declaration

    Objective-C

    @interface NXMClient : NSObject
    
    /*!
    Return the connection status.
    */
    @property (nonatomic, assign, readonly, getter=getConnectionStatus) NXMConnectionStatus connectionStatus;
    
    /*!
     Return the current user
     */
    @property (nonatomic, strong, readonly, nullable, getter=getUser) NXMUser *user;
    
    /*!
     Return the current authentication token
     */
    @property (nonatomic, strong, readonly, nullable, getter=getToken) NSString *token;
    
    /**
     init nxmClient with authentication token
     @param authToken user authentication token
     */
    - (instancetype)initWithToken:(nonnull NSString *)authToken;
    
    /*!
     Set nexmo client logger delegate
     *  @param delegate a `NXMLoggerDelegate` object.
     *
     */
    - (void)setLoggerDelegate:(nullable id <NXMLoggerDelegate>)delegate;
    
    /*!
     Set nexmo client delegate
     *  @param delegate a `NXMClientDelegate` object.
     *
     */
    - (void)setDelegate:(nonnull id <NXMClientDelegate>)delegate;
    
    /**
     login and connect to nexmo sdk.
     */
    - (void)login;
    
    /**
     Update authentication token when logged in
     @param authToken user authentication token
     */
    - (void)refreshAuthToken:(nonnull NSString *)authToken;
    
    /**
    Logout
     */
    - (void)logout;
    
    #pragma mark - Conversation
    
    /**
     Get a conversation object by id
     @param converesationId     conversation id
     @param completion          completion block
     */
    - (void)getConversationWithId:(nonnull NSString *)converesationId
                       completion:(void(^_Nullable)(NSError * _Nullable error, NXMConversation * _Nullable conversation))completion;
    
    
    /**
     Creatw a new conversation with name
    
     @param name                conversation name
     @param completion          completion block
     */
    - (void)createConversationWithName:(nonnull NSString *)name completion:(void(^_Nullable)(NSError * _Nullable error, NXMConversation * _Nullable conversation))completion;
    
    #pragma mark - Call
    
    ///**
    // Create a new call to users
    //
    // @param callees         user ids/name or pstn number to call
    // @param callType        type of the call (InApp/SERVER)
    // @param delegate        call delegate
    // @param completion      completion block
    // */
    - (void)call:(nonnull NSArray<NSString *>*)callees
        callType:(NXMCallType)callType
        delegate:(nullable id<NXMCallDelegate>)delegate
      completion:(void(^_Nullable)(NSError * _Nullable error, NXMCall * _Nullable call))completion;
    
    - (void)onMemberEvent:(NSNotification* )notification;
    
    #pragma mark - Push Notifications
    
    /**
     Enable push notification for specific device
    
     @param deviceToken     the device token
     @param isPushKit       is the app using PushKit
     @param isSandbox       is apple sandbox enviroment
     @param completion      completion block
     */
    - (void)enablePushNotificationsWithDeviceToken:(nonnull NSData *)deviceToken
                                         isPushKit:(BOOL)isPushKit
                                         isSandbox:(BOOL)isSandbox
                                        completion:(void(^_Nullable)(NSError * _Nullable error))completion;
    
    /**
     Disable push notification for the current device
     
     @param completion      completion block
     */
    - (void)disablePushNotificationsWithCompletion:(void(^_Nullable)(NSError * _Nullable error))completion;
    
    /**
     Call this method on incoming push
    
     @param userInfo    pushInfo
     @return true if nexmo push
     */
    - (BOOL)isNexmoPushWithUserInfo:(nonnull NSDictionary *)userInfo;
    
    /**
     Handle nexmo push
     Call this method when isNexmoPushWithUserInfo:userInfo return true
     
     @param userInfo    pushInfo
     @param completion  completion block
     */
    - (void)processNexmoPushWithUserInfo:(nonnull NSDictionary *)userInfo
                               completion:(void(^_Nullable)(NSError * _Nullable error))completion;
    
    @end

    Swift

    class NXMClient
  • Undocumented

    See more

    Declaration

    Objective-C

    @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

    Swift

    class NXMConversation