EMOobMessageManager

Objective-C

@protocol EMOobMessageManager <NSObject>

Swift

protocol EMOobMessageManager : NSObjectProtocol

This manager provides a way to create outgoing messages for the server and; fetch messages from or send messages to the server.

Since

3.0
  • Creates an outgoing user-to-provider message.

    Since

    3.0

    Declaration

    Objective-C

    - (id<EMOobUserToProviderMessage>)
        createUserToProviderMessageWithLocale:(NSString *)aLocale
                                   createTime:(NSTimeInterval)aCreateTime
                                      subject:(id<EMSecureString>)aSubject
                                         from:(NSString *)aFrom
                                           to:(NSString *)aTo
                                      replyTo:(NSString *)aReplyTo
                                     threadId:(NSString *)aThreadId
                                  contentType:(NSString *)aContentType
                                      content:(id<EMSecureByteArray>)aContent
                                  attachments:(NSArray *)anAttachments
                                         meta:(NSDictionary *)aMeta;

    Swift

    func createUserToProviderMessage(withLocale aLocale: String!, createTime aCreateTime: TimeInterval, subject aSubject: (any EMSecureString)!, from aFrom: String!, to aTo: String!, replyTo aReplyTo: String!, threadId aThreadId: String!, contentType aContentType: String!, content aContent: (any EMSecureByteArray)!, attachments anAttachments: [Any]!, meta aMeta: [AnyHashable : Any]!) -> (any EMOobUserToProviderMessage)!

    Parameters

    aLocale

    Locale to use to handle messages.

    aCreateTime

    Message creation time. If nil the default system time is used.

    aSubject

    Message subject.

    aFrom

    Message originator. Can be nil.

    aTo

    Message recipient.

    aReplyTo

    Message recipient to use in case a response is send by the server. Can be nil.

    aThreadId

    Message thread identifier.

    aContentType

    Message content-type.

    aContent

    Message content.

    anAttachments

    Array of attachments to the message. Can be nil.

    aMeta

    Meta data for the message. Can be nil.

    Return Value

    The user-to-provider message to be sent.

  • Creates a user message attachment.

    Since

    3.0

    Declaration

    Objective-C

    - (id<EMOobUserMessageAttachment>)
        createUserMessageAttachmentWithSubject:(id<EMSecureString>)aSubject
                                   contentType:(NSString *)aContentType
                                       content:(id<EMSecureByteArray>)aContent
                                          meta:(NSDictionary *)aMeta;

    Swift

    func createUserMessageAttachment(withSubject aSubject: (any EMSecureString)!, contentType aContentType: String!, content aContent: (any EMSecureByteArray)!, meta aMeta: [AnyHashable : Any]!) -> (any EMOobUserMessageAttachment)!

    Parameters

    aSubject

    Message subject.

    aContentType

    Message content-type.

    aContent

    Message content.

    aMeta

    Meta data for the message. Can be nil.

    Return Value

    The user message attachment to be sent.

  • Creates a generic message.

    Since

    3.0

    Declaration

    Objective-C

    - (id<EMOobGenericOutgoingMessage>)
        createGenericOutgoingMessageWithContentType:(NSString *)aContentType
                                            content:(id<EMSecureByteArray>)aContent;

    Swift

    func createGenericOutgoingMessage(withContentType aContentType: String!, content aContent: (any EMSecureByteArray)!) -> (any EMOobGenericOutgoingMessage)!

    Parameters

    aContentType

    Message content-type.

    aContent

    Message content.

    Return Value

    The generic outgoing message to be sent.

  • Creates an error message to be sent as a response.

    Since

    3.0

    Declaration

    Objective-C

    - (id<EMOobErrorMessage>)
        createOobErrorWithErrorCode:(int)anErrorCode
                   errorDescription:(NSString *)anErrorDescription
                    errorStackTrace:(NSString *)anErrorStackTrace
                        externalRef:(NSString *)anExternalRef
                               meta:(NSDictionary *)aMeta;

    Swift

    func createOobErrorWithErrorCode(_ anErrorCode: Int32, errorDescription anErrorDescription: String!, errorStackTrace anErrorStackTrace: String!, externalRef anExternalRef: String!, meta aMeta: [AnyHashable : Any]!) -> (any EMOobErrorMessage)!

    Parameters

    anErrorCode

    Error code.

    anErrorDescription

    Error description.

    anErrorStackTrace

    Error stack trace. Can be nil.

    anExternalRef

    Any external reference. Can be nil.

    aMeta

    Meta data for the message. Can be nil.

    Return Value

    The error message to be sent.

  • Creates an error message to be sent as a response.

    Since

    3.0

    Declaration

    Objective-C

    - (id<EMOobErrorMessage>)createOobErrorWithErrorCode:(int)anErrorCode
                                        errorDescription:
                                            (NSString *)anErrorDescription
                                               exception:(NSException *)anException
                                             externalRef:(NSString *)anExternalRef
                                                    meta:(NSDictionary *)aMeta;

    Swift

    func createOobErrorWithErrorCode(_ anErrorCode: Int32, errorDescription anErrorDescription: String!, exception anException: NSException!, externalRef anExternalRef: String!, meta aMeta: [AnyHashable : Any]!) -> (any EMOobErrorMessage)!

    Parameters

    anErrorCode

    Error code.

    anErrorDescription

    Error description.

    anException

    NSException object. Can be nil.

    anExternalRef

    Any external reference. Can be nil.

    aMeta

    Meta data for the message. Can be nil.

    Return Value

    The error message to be sent.

  • Fetches a message from the server. This method retrieves the first message from server queue.

    Warning

    This method blocks the calling thread potentially for a very long time (like tens of seconds or even more, depending on the quality of the mobile network connection).

    Since

    3.0

    Declaration

    Objective-C

    - (id<EMOobFetchMessageResponse>)fetchWithTimeout:(NSInteger)aTimeout
                                                error:(NSError **)anError;

    Swift

    func fetch(withTimeout aTimeout: Int) throws -> any EMOobFetchMessageResponse

    Parameters

    aTimeout

    Maximum time in seconds to wait for an incoming message.

    anError

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    The incoming message response if any.

  • Fetches a message from the server. This method retrieves the first message from server queue.

    Warning

    This method blocks the calling thread potentially for a very long time (like tens of seconds or even more, depending on the quality of the mobile network connection).

    Since

    4.7

    Declaration

    Objective-C

    - (id<EMOobFetchMessageResponse>)fetchWithTimeout:(NSInteger)aTimeout
                                     requestParameter:
                                         (EMOobRequestParameter *)aParam
                                                error:(NSError **)anError;

    Swift

    func fetch(withTimeout aTimeout: Int, requestParameter aParam: EMOobRequestParameter!) throws -> any EMOobFetchMessageResponse

    Parameters

    aTimeout

    Maximum time in seconds to wait for an incoming message.

    aParam

    The request parameter object carrying the additional parameters, i.e. custom HTTP headers.

    anError

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    The incoming message response if any.

  • Fetches a message from the server. This method retrieves the first message from server queue.

    Warning

    This method is executed asynchronously

    Since

    3.0

    Declaration

    Objective-C

    - (void)fetchWithTimeout:(int)aTimeout
           completionHandler:(void (^)(id<EMOobFetchMessageResponse>,
                                       NSError *))aCompletionHandler;

    Swift

    func fetch(withTimeout aTimeout: Int32) async throws -> (any EMOobFetchMessageResponse)?

    Parameters

    aTimeout

    Maximum time in seconds to wait for an incoming message.

    aCompletionHandler

    The block to invoke on the main thread upon completion which contains the response and error information if any.

  • Fetches a message from the server. This method retrieves the first message from server queue.

    Warning

    This method is executed asynchronously

    Since

    4.7

    Declaration

    Objective-C

    - (void)fetchWithTimeout:(int)aTimeout
            requestParameter:(EMOobRequestParameter *)aParam
           completionHandler:(void (^)(id<EMOobFetchMessageResponse>,
                                       NSError *))aCompletionHandler;

    Swift

    func fetch(withTimeout aTimeout: Int32, requestParameter aParam: EMOobRequestParameter!) async throws -> (any EMOobFetchMessageResponse)?

    Parameters

    aTimeout

    Maximum time in seconds to wait for an incoming message.

    aParam

    The request parameter object carrying the additional parameters, i.e. custom HTTP headers.

    aCompletionHandler

    The block to invoke on the main thread upon completion which contains the response and error information if any.

  • Fetches a message from the server. This method retrieves a message with a specific identifier.

    Warning

    This method blocks the calling thread potentially for a very long time (like tens of seconds or even more, depending on the quality of the mobile network connection).

    Since

    3.0

    Declaration

    Objective-C

    - (id<EMOobFetchMessageResponse>)fetchWithMessageId:(NSString *)aMessageId
                                                  error:(NSError **)anError;

    Swift

    func fetch(withMessageId aMessageId: String!) throws -> any EMOobFetchMessageResponse

    Parameters

    aMessageId

    Identifier of the message to fetch.

    anError

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    The incoming message response if any.

  • Fetches a message from the server. This method retrieves a message with a specific identifier.

    Warning

    This method blocks the calling thread potentially for a very long time (like tens of seconds or even more, depending on the quality of the mobile network connection).

    Since

    4.7

    Declaration

    Objective-C

    - (id<EMOobFetchMessageResponse>)fetchWithMessageId:(NSString *)aMessageId
                                       requestParameter:
                                           (EMOobRequestParameter *)aParam
                                                  error:(NSError **)anError;

    Swift

    func fetch(withMessageId aMessageId: String!, requestParameter aParam: EMOobRequestParameter!) throws -> any EMOobFetchMessageResponse

    Parameters

    aMessageId

    Identifier of the message to fetch.

    aParam

    The request parameter object carrying the additional parameters, i.e. custom HTTP headers.

    anError

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    The incoming message response if any.

  • Fetches a message from the server. This method retrieves a message with a specific identifier.

    Warning

    This method is executed asynchronously

    Since

    3.0

    Declaration

    Objective-C

    - (void)fetchWithMessageId:(NSString *)aMessageId
             completionHandler:(void (^)(id<EMOobFetchMessageResponse>,
                                         NSError *))aCompletionHandler;

    Swift

    func fetch(withMessageId aMessageId: String!) async throws -> (any EMOobFetchMessageResponse)?

    Parameters

    aMessageId

    Identifier of the message to fetch.

    aCompletionHandler

    The block to invoke on the main thread upon completion which contains the response and error information if any.

  • Fetches a message from the server. This method retrieves a message with a specific identifier.

    Warning

    This method is executed asynchronously

    Since

    4.7

    Declaration

    Objective-C

    - (void)fetchWithMessageId:(NSString *)aMessageId
              requestParameter:(EMOobRequestParameter *)aParam
             completionHandler:(void (^)(id<EMOobFetchMessageResponse>,
                                         NSError *))aCompletionHandler;

    Swift

    func fetch(withMessageId aMessageId: String!, requestParameter aParam: EMOobRequestParameter!) async throws -> (any EMOobFetchMessageResponse)?

    Parameters

    aMessageId

    Identifier of the message to fetch.

    aParam

    The request parameter object carrying the additional parameters, i.e. custom HTTP headers.

    aCompletionHandler

    The block to invoke on the main thread upon completion which contains the response and error information if any.

  • Sends a message to the server

    Warning

    This method blocks the calling thread potentially for a very long time (like tens of seconds or even more, depending on the quality of the mobile network connection).

    Since

    3.0

    Declaration

    Objective-C

    - (id<EMOobMessageResponse>)sendWithMessage:(id<EMOobOutgoingMessage>)aMessage
                                          error:(NSError **)anError;

    Swift

    func send(with aMessage: (any EMOobOutgoingMessage)!) throws -> any EMOobMessageResponse

    Parameters

    aMessage

    The object that will be use to post the result to the UI thread.

    anError

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    Result of the request.

  • Sends a message to the server

    Warning

    This method blocks the calling thread potentially for a very long time (like tens of seconds or even more, depending on the quality of the mobile network connection).

    Since

    4.7

    Declaration

    Objective-C

    - (id<EMOobMessageResponse>)sendWithMessage:(id<EMOobOutgoingMessage>)aMessage
                               requestParameter:(EMOobRequestParameter *)aParam
                                          error:(NSError **)anError;

    Swift

    func send(with aMessage: (any EMOobOutgoingMessage)!, requestParameter aParam: EMOobRequestParameter!) throws -> any EMOobMessageResponse

    Parameters

    aMessage

    The object that will be use to post the result to the UI thread.

    aParam

    The request parameter object carrying the additional parameters, i.e. custom HTTP headers.

    anError

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    Result of the request.

  • Sends a message to the server.

    Warning

    This method is executed asynchronously

    Since

    3.0

    Declaration

    Objective-C

    - (void)sendWithMessage:(id<EMOobOutgoingMessage>)aMessage
          completionHandler:
              (void (^)(id<EMOobMessageResponse>, NSError *))aCompletionHandler;

    Swift

    func send(with aMessage: (any EMOobOutgoingMessage)!) async throws -> (any EMOobMessageResponse)?

    Parameters

    aMessage

    The message to send.

    aCompletionHandler

    The block to invoke on the main thread upon completion which contains the response and error information if any.

  • Sends a message to the server.

    Warning

    This method is executed asynchronously

    Since

    4.7

    Declaration

    Objective-C

    - (void)sendWithMessage:(id<EMOobOutgoingMessage>)aMessage
           requestParameter:(EMOobRequestParameter *)aParam
          completionHandler:
              (void (^)(id<EMOobMessageResponse>, NSError *))aCompletionHandler;

    Swift

    func send(with aMessage: (any EMOobOutgoingMessage)!, requestParameter aParam: EMOobRequestParameter!) async throws -> (any EMOobMessageResponse)?

    Parameters

    aMessage

    The message to send.

    aParam

    The request parameter object carrying the additional parameters, i.e. custom HTTP headers.

    aCompletionHandler

    The block to invoke on the main thread upon completion which contains the response and error information if any.

  • Sends a message acknowledgment to the server

    Warning

    This method blocks the calling thread potentially for a very long time (like tens of seconds or even more, depending on the quality of the mobile network connection).

    Since

    3.0

    Declaration

    Objective-C

    - (id<EMOobResponse>)acknowledgeWithMessage:(id<EMOobIncomingMessage>)aMessage
                                          error:(NSError **)anError;

    Swift

    func acknowledge(with aMessage: (any EMOobIncomingMessage)!) throws -> any EMOobResponse

    Parameters

    aMessage

    The incoming message to acknowledge.

    anError

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    Result of the request.

  • Sends a message acknowledgment to the server

    Warning

    This method blocks the calling thread potentially for a very long time (like tens of seconds or even more, depending on the quality of the mobile network connection).

    Since

    4.7

    Declaration

    Objective-C

    - (id<EMOobResponse>)acknowledgeWithMessage:(id<EMOobIncomingMessage>)aMessage
                               requestParameter:(EMOobRequestParameter *)aParam
                                          error:(NSError **)anError;

    Swift

    func acknowledge(with aMessage: (any EMOobIncomingMessage)!, requestParameter aParam: EMOobRequestParameter!) throws -> any EMOobResponse

    Parameters

    aMessage

    The incoming message to acknowledge.

    aParam

    The request parameter object carrying the additional parameters, i.e. custom HTTP headers.

    anError

    If an error occurs, upon return contains an NSError object that describes the problem. If you are not interested in possible errors, you may pass in NULL.

    Return Value

    Result of the request.

  • Sends a message acknowledgment to the server.

    Warning

    This method is executed asynchronously

    Since

    3.0

    Declaration

    Objective-C

    - (void)acknowledgeWithMessage:(id<EMOobIncomingMessage>)aMessage
                 completionHandler:
                     (void (^)(id<EMOobResponse>, NSError *))aCompletionHandler;

    Swift

    func acknowledge(with aMessage: (any EMOobIncomingMessage)!) async throws -> (any EMOobResponse)?

    Parameters

    aMessage

    The incoming message to acknowledge.

    aCompletionHandler

    The block to invoke on the main thread upon completion which contains the response and error information if any.

  • Sends a message acknowledgment to the server.

    Warning

    This method is executed asynchronously

    Since

    4.7

    Declaration

    Objective-C

    - (void)acknowledgeWithMessage:(id<EMOobIncomingMessage>)aMessage
                  requestParameter:(EMOobRequestParameter *)aParam
                 completionHandler:
                     (void (^)(id<EMOobResponse>, NSError *))aCompletionHandler;

    Swift

    func acknowledge(with aMessage: (any EMOobIncomingMessage)!, requestParameter aParam: EMOobRequestParameter!) async throws -> (any EMOobResponse)?

    Parameters

    aMessage

    The incoming message to acknowledge.

    aParam

    The request parameter object carrying the additional parameters, i.e. custom HTTP headers.

    aCompletionHandler

    The block to invoke on the main thread upon completion which contains the response and error information if any.