Inherits from NSObject
Declared in NetmeraInbox.h

Overview

This class provides methods and properties needed after initial fetch of the list of push notifications with given filter. Filter properties of an inbox instance could not be changed. If you need modified filter properties, you have to start a new fetch operation using [Netmera fetchInboxUsingFilter:completion:] method.

Tasks

  • – init
  •   objects

    List of fetched push objects.

    This list contains all objects fetched in an aggregated manner.

    That is, if you have fetched 3 pages and your page size 20, this list will contain all 60 objects, rather than holding the data of only last page.

    property
  •   hasNextPage

    Use this boolean to check if inbox still has next pages to fetch

    property
  •   pageSize

    Number of push objects to be returned for each page.

    property
  • – countForStatus:

    Returns count of objects matching with given status options.

    You can combine different status types using @c OR @c (|) operator.

  • – fetchNextPageWithCompletionBlock:

    Fetch the contents of the next page from Netmera servers.

    NetmeraInbox object fetches and stores the list of push objects incrementally respecting to the @c pageSize value of the @c NetmeraInboxFilter object. Use this method to fetch the list of push objects belonging to the next page.

    Given completion block will be called after fetch operation has finished. If @c error parameter is @c nil, it means that the fetch operation has been succeeded.

  • – updateStatus:forPushObjects:completion:

    Update status of given push objects.

Properties

hasNextPage

@property (nonatomic, assign, readonly) BOOL hasNextPage
Discussion

Use this boolean to check if inbox still has next pages to fetch

Declared In

NetmeraInbox.h

objects

List of fetched push objects.

This list contains all objects fetched in an aggregated manner.

That is, if you have fetched 3 pages and your page size 20, this list will contain all 60 objects, rather than holding the data of only last page.

@property (nonatomic, strong, readonly) NSMutableArray<NetmeraPushObject*> *objects

Declared In

NetmeraInbox.h

pageSize

@property (nonatomic, assign, readonly) int pageSize
Discussion

Number of push objects to be returned for each page.

Declared In

NetmeraInbox.h

Instance Methods

countForStatus:

Returns count of objects matching with given status options.

You can combine different status types using @c OR @c (|) operator.

- (NSUInteger)countForStatus:(NetmeraInboxStatus)status

Parameters

status

Status types to include while calculating count.

Return Value

NSUInteger Number of objects matching with any of the given status types.

Declared In

NetmeraInbox.h

fetchNextPageWithCompletionBlock:

- (void)fetchNextPageWithCompletionBlock:(void ( ^ ) ( NSError *error ))completionBlock
Discussion

Note: If @c hasNextPage value is NO, this method immediately calls completion block with an appropriate error.

Parameters

completionBlock

Block to be called on fetch completion.

Declared In

NetmeraInbox.h

init

- (instancetype)init

updateStatus:forPushObjects:completion:

- (void)updateStatus:(NetmeraInboxStatus)status forPushObjects:(NSArray<NetmeraPushObject*> *)objects completion:(void ( ^ ) ( NSError *error ))completionBlock
Discussion

Update status of given push objects.

Calling this method will update the inbox status of given push objects, and result will be informed via given completion block. A @c nil @c error value means operation succeeded.

Setting multiple status options to status parameter will result in an immediate error.

Parameters

status

Status option to be set upon given push objects.

objects

The list of push objects whose status will be updated.

completionBlock

Block to be called on update completion.

Declared In

NetmeraInbox.h