com.netmera.mobile
Class NetmeraPushInboxDataController

java.lang.Object
  extended by com.netmera.mobile.NetmeraPushInboxDataController

public class NetmeraPushInboxDataController
extends java.lang.Object

This class helps you to manage push inbox operations. If you want to write your own push inbox code, you can use this class to get push notification. You can mark as read/unread and delete rich push notifications using the methods in the class.


Constructor Summary
NetmeraPushInboxDataController()
           
 
Method Summary
static java.util.List<NetmeraRichPushObject> getUserRelatedPushNotifications()
          Gets user related notifications from Netmera.
static java.util.List<NetmeraRichPushObject> getUserRelatedPushNotifications(NetmeraCache.CacheType cacheType)
          Gets user related notifications using cache policy from Netmera.
static void getUserRelatedPushNotificationsInBackground(NetmeraCache.CacheType cacheType, NetmeraCallback<java.util.List<NetmeraRichPushObject>> callback)
          Gets user related notifications using cache policy from Netmera in background.
static void getUserRelatedPushNotificationsInBackground(NetmeraCallback<java.util.List<NetmeraRichPushObject>> callback)
          Gets user related notifications from Netmera in background.
static void markPushAsDeleted(java.lang.String... notificationIds)
          Marks the notifications as deleted.
static void markPushAsRead(java.lang.String... notificationIds)
          Marks the notifications as read.
static void markPushAsUnread(java.lang.String... notificationIds)
          Marks the notifications as unread.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetmeraPushInboxDataController

public NetmeraPushInboxDataController()
Method Detail

getUserRelatedPushNotificationsInBackground

public static void getUserRelatedPushNotificationsInBackground(NetmeraCache.CacheType cacheType,
                                                               NetmeraCallback<java.util.List<NetmeraRichPushObject>> callback)
Gets user related notifications using cache policy from Netmera in background. Push inbox is user specific. You can get unread and read notifications using this method. Deleted notifications will not be retrieved anymore after deletion.

Parameters:
cacheType - NetmeraCache.CacheType object
callback - - NetmeraCallback.onFail(NetmeraException) or NetmeraCallback.onSuccess(Object) methods called when the operation finishes.

getUserRelatedPushNotificationsInBackground

public static void getUserRelatedPushNotificationsInBackground(NetmeraCallback<java.util.List<NetmeraRichPushObject>> callback)
Gets user related notifications from Netmera in background. Push inbox is user specific. You can get unread and read notifications using this method. Deleted notifications will not be retrieved anymore after deletion.

Parameters:
callback - - NetmeraCallback.onFail(NetmeraException) or NetmeraCallback.onSuccess(Object) methods called when the operation finishes.

getUserRelatedPushNotifications

public static java.util.List<NetmeraRichPushObject> getUserRelatedPushNotifications(NetmeraCache.CacheType cacheType)
                                                                             throws NetmeraException
Gets user related notifications using cache policy from Netmera. Push inbox is user specific. You can get unread and read notifications using this method. Deleted notifications will not be retrieved anymore after deletion.

Parameters:
cacheType - NetmeraCache.CacheType object
Returns:
a list of NetmeraRichPushObject
Throws:
NetmeraException - if there is any problem related with network or cached data.

getUserRelatedPushNotifications

public static java.util.List<NetmeraRichPushObject> getUserRelatedPushNotifications()
                                                                             throws NetmeraException
Gets user related notifications from Netmera. Push inbox is user specific. You can get unread and read notifications using this method. Deleted notifications will not be retrieved anymore after deletion.

Returns:
a list of NetmeraRichPushObject
Throws:
NetmeraException - if there is any network problem.

markPushAsRead

public static void markPushAsRead(java.lang.String... notificationIds)
                           throws NetmeraException
Marks the notifications as read. You can give the method a String array of notification ids or just one String notification id. The parameter is var args.

Parameters:
notificationIds - notification id var args
Throws:
NetmeraException - if there is a problem with server connection.

markPushAsUnread

public static void markPushAsUnread(java.lang.String... notificationIds)
                             throws NetmeraException
Marks the notifications as unread. You can give the method a String array of notification ids or just one String notification id. The parameter is var args.

Parameters:
notificationIds - notification id var args
Throws:
NetmeraException - if there is a problem with server connection.

markPushAsDeleted

public static void markPushAsDeleted(java.lang.String... notificationIds)
                              throws NetmeraException
Marks the notifications as deleted. You can give the method a String array of notification ids or just one String notification id. The parameter is var args.

Parameters:
notificationIds - notification id var args
Throws:
NetmeraException - if there is a problem with server connection.