EMMobileMessageManager
Objective-C
@interface EMMobileMessageManager : NSObject
Swift
class EMMobileMessageManager : NSObject
The manager provides way to create outgoing messages for the server and send/fetch messages to/from the server.
Since
5.3-
Fetch a message from the server. This method fetches the first message from server queue.
Declaration
Objective-C
- (void)fetchMessageWithTimeout:(NSTimeInterval)timeout customHeaders: (nullable NSDictionary<NSString *, NSString *> *)headers completionHandler: (nonnull void (^)(EMFetchMessageResponse *_Nullable, NSError *_Nullable))completionHandler;Swift
func fetchMessage(timeout: TimeInterval, customHeaders headers: [String : String]?) async throws -> EMFetchMessageResponseParameters
timeoutMaximum time in second to wait for an incoming message.
headersThe request parameter containing custom header.
completionHandlerThe block to invoke on the main thread upon completion which contains the response and error information if any.
-
Fetch a message from the server. This method fetches the first message from server queue.
Declaration
Objective-C
- (void)fetchMessageWithMessageId:(nonnull NSString *)messageId customHeaders: (nullable NSDictionary<NSString *, NSString *> *)headers completionHandler: (nonnull void (^)(EMFetchMessageResponse *_Nullable, NSError *_Nullable))completionHandler;Swift
func fetchMessage(messageId: String, customHeaders headers: [String : String]?) async throws -> EMFetchMessageResponseParameters
messageIdIdentifier of the message to fetch.
headersThe request parameter containing custom header.
completionHandlerThe 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.
Declaration
Objective-C
- (void)acknowledgeMessage:(nonnull EMIncomingMessage *)incomingMessage customHeaders: (nullable NSDictionary<NSString *, NSString *> *)headers completionHandler: (nonnull void (^)(BOOL, NSError *_Nullable))completionHandler;Swift
func acknowledge(message incomingMessage: EMIncomingMessage, customHeaders headers: [String : String]?) async throws -> BoolParameters
incomingMessageThe incoming message to acknowledge.
headersThe request parameter containing custom header.
completionHandlerThe block to invoke on the main thread upon completion which contains the response and error information if any.
-
Sends a message to the server.
Declaration
Objective-C
- (void)sendMessage:(nonnull EMOutgoingMessage *)outgoingMessage customHeaders:(nullable NSDictionary<NSString *, NSString *> *)headers completionHandler:(nonnull void (^)(EMSendMessageResponse *_Nullable, NSError *_Nullable))completionHandler;Swift
func send(message outgoingMessage: EMOutgoingMessage, customHeaders headers: [String : String]?) async throws -> EMSendMessageResponseParameters
outgoingMessageThe message to send.
headersThe request parameter containing custom header.
completionHandlerThe block to invoke on the main thread upon completion which contains the response and error information if any.
-
Creates a generic message that can be sent to the OOB server.
Declaration
Objective-C
- (nonnull EMOutgoingMessage *) createGenericOutgoingMessageWithContentType:(nonnull NSString *)contentType content:(nonnull NSData *)content;Swift
func createGenericOutgoingMessage(contentType: String, content: Data) -> EMOutgoingMessageParameters
contentTypeMessage content-type.
contentMessage content.
Return Value
The generic message ready to be sent.
EMMobileMessageManager Class Reference