|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netmera.mobile.NetmeraPopupService
public class NetmeraPopupService
This is the main class to manage pop-ups in Netmera. With the help of this
class, you can start/stop listening pop-ups from Netmera to get current user
pop-ups by using register(long)
and
unregister()
methods.
Method Summary | |
---|---|
static boolean |
appHasPopupToShow()
|
static boolean |
appHasPopupToShow(java.lang.String eventName)
|
static java.util.List<NetmeraPopup> |
getAllPopupsToShow()
|
static java.util.List<NetmeraPopup> |
getEventRelatedPopupsToShow(java.lang.String eventName)
|
static java.util.List<NetmeraPopup> |
getUserPopupsFromNetmera()
Gets user&event related pop-ups from Netmera. |
static void |
getUserPopupsFromNetmeraInBackground(NetmeraCallback<java.util.List<NetmeraPopup>> callback)
Gets user&event related pop-ups from Netmera in background. |
static boolean |
isRegistered()
|
static void |
register(long refreshPeriodInMilliseconds)
Initializes NetmeraPopupService , registers the device to Netmera
Popup on server and starts checking pop-ups from Netmera with the given
period. i.e. if you set refresh period to 5000, this means service will
retrieve pop-ups from Netmera in every 5 seconds. |
static void |
unregister()
Stops retrieving pop-ups from Netmera. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void register(long refreshPeriodInMilliseconds) throws NetmeraException
NetmeraPopupService
, registers the device to Netmera
Popup on server and starts checking pop-ups from Netmera with the given
period. i.e. if you set refresh period to 5000, this means service will
retrieve pop-ups from Netmera in every 5 seconds.
refreshPeriodInMilliseconds
- refresh period in milli seconds
NetmeraException
- if your Netmera account type does not have Pop-up usage
permission.public static void unregister()
NetmeraPopupService
until you call
register(long)
. This method does not
unregister the device on Netmera servers. It stops listening new popups
and retrieving them.
public static void getUserPopupsFromNetmeraInBackground(NetmeraCallback<java.util.List<NetmeraPopup>> callback)
callback
- - NetmeraCallback.onFail(NetmeraException)
or
NetmeraCallback.onSuccess(Object)
methods called when
count operation finishes.public static java.util.List<NetmeraPopup> getUserPopupsFromNetmera() throws NetmeraException
NetmeraPopup
NetmeraException
- if your api call limit is exceeded.public static boolean appHasPopupToShow()
public static boolean appHasPopupToShow(java.lang.String eventName)
eventName
- choose from NetmeraPopup.EventType
or write your custom event name.
public static java.util.List<NetmeraPopup> getEventRelatedPopupsToShow(java.lang.String eventName)
eventName
- choose from NetmeraPopup.EventType
or write your custom event name.
NetmeraPopup
if there is any pop-up related
with the given event, else empty list.public static java.util.List<NetmeraPopup> getAllPopupsToShow()
NetmeraPopup
if there is any pop-up, else empty
list.public static boolean isRegistered()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |