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-
-createUserToProviderMessageWithLocale:createTime: subject: from: to: replyTo: threadId: contentType: content: attachments: meta: 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
aLocaleLocale to use to handle messages.
aCreateTimeMessage creation time. If
nilthe default system time is used.aSubjectMessage subject.
aFromMessage originator. Can be
nil.aToMessage recipient.
aReplyToMessage recipient to use in case a response is send by the server. Can be
nil.aThreadIdMessage thread identifier.
aContentTypeMessage content-type.
aContentMessage content.
anAttachmentsArray of attachments to the message. Can be
nil.aMetaMeta 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
aSubjectMessage subject.
aContentTypeMessage content-type.
aContentMessage content.
aMetaMeta 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
aContentTypeMessage content-type.
aContentMessage 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
anErrorCodeError code.
anErrorDescriptionError description.
anErrorStackTraceError stack trace. Can be
nil.anExternalRefAny external reference. Can be
nil.aMetaMeta 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
anErrorCodeError code.
anErrorDescriptionError description.
anExceptionNSException object. Can be
nil.anExternalRefAny external reference. Can be
nil.aMetaMeta 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 EMOobFetchMessageResponseParameters
aTimeoutMaximum time in seconds to wait for an incoming message.
anErrorIf 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 EMOobFetchMessageResponseParameters
aTimeoutMaximum time in seconds to wait for an incoming message.
aParamThe request parameter object carrying the additional parameters, i.e. custom HTTP headers.
anErrorIf 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
aTimeoutMaximum time in seconds to wait for an incoming message.
aCompletionHandlerThe 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
aTimeoutMaximum time in seconds to wait for an incoming message.
aParamThe request parameter object carrying the additional parameters, i.e. custom HTTP headers.
aCompletionHandlerThe 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 EMOobFetchMessageResponseParameters
aMessageIdIdentifier of the message to fetch.
anErrorIf 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 EMOobFetchMessageResponseParameters
aMessageIdIdentifier of the message to fetch.
aParamThe request parameter object carrying the additional parameters, i.e. custom HTTP headers.
anErrorIf 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
aMessageIdIdentifier of the message to fetch.
aCompletionHandlerThe 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
aMessageIdIdentifier of the message to fetch.
aParamThe request parameter object carrying the additional parameters, i.e. custom HTTP headers.
aCompletionHandlerThe 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 EMOobMessageResponseParameters
aMessageThe object that will be use to post the result to the UI thread.
anErrorIf 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 EMOobMessageResponseParameters
aMessageThe object that will be use to post the result to the UI thread.
aParamThe request parameter object carrying the additional parameters, i.e. custom HTTP headers.
anErrorIf 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
aMessageThe message to send.
aCompletionHandlerThe 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
aMessageThe message to send.
aParamThe request parameter object carrying the additional parameters, i.e. custom HTTP headers.
aCompletionHandlerThe 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 EMOobResponseParameters
aMessageThe incoming message to acknowledge.
anErrorIf 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 EMOobResponseParameters
aMessageThe incoming message to acknowledge.
aParamThe request parameter object carrying the additional parameters, i.e. custom HTTP headers.
anErrorIf 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
aMessageThe incoming message to acknowledge.
aCompletionHandlerThe 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
aMessageThe incoming message to acknowledge.
aParamThe request parameter object carrying the additional parameters, i.e. custom HTTP headers.
aCompletionHandlerThe block to invoke on the main thread upon completion which contains the response and error information if any.
EMOobMessageManager Protocol Reference