Captainup  2.4
Instance Methods | List of all members
<CPTInbox> Protocol Reference

#import <CPTInbox.h>

Inheritance diagram for <CPTInbox>:

Instance Methods

(void) - addListener:
 
(void) - removeListener:
 
(void) - query:to:
 
(NSInteger) - getNewMessageCount
 
(void) - checkForNewMessages
 
(void) - markAllAsRead
 
(void) - markMessageAsRead:
 
(nonnull NSArray< id< CPTInboxItem >> *) - getUnreadInboxMessages
 
(nonnull NSArray< id< CPTInboxItem >> *) - getUnreadInboxNotifications
 

Detailed Description

Allows to query and mark as messages as read of the user's inbox.

Method Documentation

◆ checkForNewMessages()

- (void) checkForNewMessages

Checks if there are any new unread messages and updates the inbox accordingly. This method check with the Captain Up Servers asynchronously and will notify it is done using a listener. Every subsequent calls to query will be based on these results (meaning, determining which Inbox Item is unread). Do not call this method if you configured the Captain Up Framework to periodically check for Inbox updates. To set up periodic updates, specify a positive integer value for the key "inbox_update_period" in the Captain Up Configuration file. If you did not configure automatic update of the Inbox, make sure you call this method before calling query.

◆ getUnreadInboxMessages()

- (nonnull NSArray<id<CPTInboxItem>>*) getUnreadInboxMessages

Get list of unread inbox messages items

◆ getUnreadInboxNotifications()

- (nonnull NSArray<id<CPTInboxItem>>*) getUnreadInboxNotifications

Get list of unread inbox notifications items

◆ markAllAsRead()

- (void) markAllAsRead

Marks all of the user's inbox as read . This method is asynchronous. In case of an error, an error will be raised as an event to the inbox's error listeners.

◆ markMessageAsRead:()

- (void) markMessageAsRead: (nonnull NSString *)  messageID

Marks a selected message of the user's inbox as read . This method is asynchronous. In case of an error, an error will be raised as an event to the inbox's error listeners.

◆ query:to:()

- (void) query: (nonnull id< CPTQuery >)  query
to: (RESPONSE_CALLBACK(NSArray< id< CPTInboxItem >> *))  callback 

Retrieves the user's inbox given a query.

Parameters
queryquery parameters. To create a query object use CPTQueryBuilder.
callbacka callback that will contain the response and any exception that might have risen during the execution.

The documentation for this protocol was generated from the following file: