UAInboxMessageList Class Reference
Inherits from | NSObject |
Declared in | UAInboxMessageList.h |
Overview
The primary interface to the contents of the inbox. Use this class to asychronously retrieve messges from the server, delete or mark messages as read, retrieve individual messages from the list.
Properties
isBatchUpdating
YES if message batching is currently in progress. NO otherwise.
@property (readonly) BOOL isBatchUpdating
Declared In
UAInboxMessageList.h
isRetrieving
YES if retrieving message list is currently in progress. NO otherwise.
@property (readonly) BOOL isRetrieving
Declared In
UAInboxMessageList.h
messages
The list of messages on disk as an NSArray.
@property (atomic, readonly, strong) NSArray<UAInboxMessage*> *messages
Declared In
UAInboxMessageList.h
unreadCount
The number of messages that are currently unread or -1 if the message list is not loaded.
@property (assign) NSInteger unreadCount
Declared In
UAInboxMessageList.h
Instance Methods
markMessagesDeleted:completionHandler:
Marks messages deleted. They will be marked locally as deleted and synced with Urban Airship on the next message retrieval.
- (nullable UADisposable *)markMessagesDeleted:(NSArray *)messages completionHandler:(nullable UAInboxMessageListCallbackBlock)completionHandler
Parameters
- messages
The array of messages to be marked deleted.
- completionHandler
An optional completion handler.
Return Value
A UADisposable token which can be used to cancel callback execution, or nil if the array of messages to mark deleted is empty.
Declared In
UAInboxMessageList.h
markMessagesRead:completionHandler:
Marks messages read. They will be marked locally as read and synced with Urban Airship on the next message retrieval.
- (nullable UADisposable *)markMessagesRead:(NSArray *)messages completionHandler:(nullable UAInboxMessageListCallbackBlock)completionHandler
Parameters
- messages
The array of messages to be marked read.
- completionHandler
An optional completion handler.
Return Value
A UADisposable token which can be used to cancel callback execution, or nil if the array of messages to mark read is empty.
Declared In
UAInboxMessageList.h
messageCount
Returns the number of messages currently in the inbox.
- (NSUInteger)messageCount
Return Value
The message count as an integer.
Declared In
UAInboxMessageList.h
messageForBodyURL:
Returns the message associated with a particular URL.
- (nullable UAInboxMessage *)messageForBodyURL:(NSURL *)url
Parameters
- url
The URL of the message
Return Value
The associated UAInboxMessage object or nil if a message was unable to be found.
Declared In
UAInboxMessageList.h
messageForID:
Returns the message associated with a particular ID.
- (nullable UAInboxMessage *)messageForID:(NSString *)messageID
Parameters
- messageID
The message ID as an NSString.
Return Value
The associated UAInboxMessage object or nil if a message was unable to be found.
Declared In
UAInboxMessageList.h
retrieveMessageListWithSuccessBlock:withFailureBlock:
Fetch new messages from the server. If the associated user has not yet been created, this will be a no-op.
- (nullable UADisposable *)retrieveMessageListWithSuccessBlock:(nullable UAInboxMessageListCallbackBlock)successBlock withFailureBlock:(nullable UAInboxMessageListCallbackBlock)failureBlock
Parameters
- successBlock
A block to be executed if message retrieval succeeds.
- failureBlock
A block to be executed if message retrieval fails.
Return Value
A UADisposable token which can be used to cancel callback execution. This value will be nil if the associated user has not yet been created.
Declared In
UAInboxMessageList.h