Package com.netmera
Class NetmeraInbox
java.lang.Object
com.netmera.NetmeraInbox
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 via
Netmera.fetchInbox(NetmeraInboxFilter, NetmeraInboxFetchCallback)-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionintcountForStatus(int status) Returns count of objects matching with given status options.voidFetch the contents of the next page from Netmera servers.booleanUse this boolean to check if inbox still has next pages to fetchAccessing the list which contains all objects fetched in an aggregated manner.voidupdateStatus(List<NetmeraPushObject> pushObjectList, int inboxStatus, NetmeraInbox.NetmeraInboxStatusCallback callback) Update status of given push objects.
-
Method Details
-
fetchNextPage
Fetch the contents of the next page from Netmera servers. NetmeraInbox object fetches and stores the list of push objects incrementally respecting to thepageSizevalue of theNetmeraInboxFilterobject. Use this method to fetch the list of push objects belonging to the next page. When fetch process is finished, given callback will be called. Iferrorparameter isnull, it means that the fetch operation has been succeeded.- Parameters:
callback- ANetmeraInbox.NetmeraInboxFetchCallbackto be triggered after fetch process is completed.
-
updateStatus
public void updateStatus(@NonNull List<NetmeraPushObject> pushObjectList, int inboxStatus, @NonNull NetmeraInbox.NetmeraInboxStatusCallback callback) Update status of given push objects. Calling this method will update the inbox status of given push objects, and result will be informed via givenNetmeraInbox.NetmeraInboxStatusCallbackobject. Anullerrorvalue means operation succeeded. Setting multiple status options to status parameter will result in an immediate error.- Parameters:
pushObjectList- The list of push objects whose status will be updated.inboxStatus- Status option to be set upon given push objects.callback- ANetmeraInbox.NetmeraInboxStatusCallbackto be triggered after update process is completed.
-
pushObjects
Accessing the list which 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.- Returns:
- List of fetched push objects.
-
countForStatus
public int countForStatus(int status) Returns count of objects matching with given status options. You can combine different status types using|operator.- Parameters:
status- Status types to include while calculating count.- Returns:
- Number of objects matching with any of the given status types.
-
hasNextPage
public boolean hasNextPage()Use this boolean to check if inbox still has next pages to fetch- Returns:
- True if next page is available, false otherwise.
-