|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.netmera.mobile.NetmeraPushService
public class NetmeraPushService
This is the main class to manage push notifications in Netmera. With the help of this class, you can register/unregister devices into different groups to get notification.
Nested Class Summary | |
---|---|
static class |
NetmeraPushService.NotificationStyleActionController
This class is used to set actions for new notification styles of Android. |
Constructor Summary | |
---|---|
NetmeraPushService()
|
Method Summary | |
---|---|
static void |
disablePushInbox()
Disables push inbox. |
static void |
enablePushInbox()
Enables push inbox. |
static void |
getDeviceDetailInBackground(android.content.Context context,
NetmeraCallback<NetmeraDeviceDetail> callback)
Retrieves the detailed information of a registered device in the background thread. |
static void |
getDeviceGroupsInBackground(int max,
int page,
NetmeraCallback<java.util.List<java.lang.String>> callback)
Deprecated. |
static void |
getDeviceGroupsInBackground(NetmeraCallback<java.util.List<java.lang.String>> callback)
Deprecated. |
static java.lang.String |
getPushMessage()
Retrieves the latest arrived push notification message |
static java.lang.String |
getRegistrationId(android.content.Context context)
Retrieves the registration id of the registered device.It returns empty string if not registered. |
static void |
getTagsInBackground(int max,
int page,
NetmeraCallback<java.util.List<java.lang.String>> callback)
Retrieves the specified tags list of all registered devices in the background thread. |
static void |
getTagsInBackground(NetmeraCallback<java.util.List<java.lang.String>> callback)
Retrieves the first 10 tags of all registered devices in the background thread. |
static boolean |
handleRichPush(android.app.Activity pushActivity)
If the coming push notification is rich, the method creates a web view and loads the content of the notification. |
static boolean |
handleRichPush(android.app.Activity pushActivity,
java.util.List<NetmeraJavascriptInterface> javascriptInterfaces)
If the coming push notification is rich, the method creates a web view, adds given list of javascriptInterfaces to the web view and loads the content of the notification. |
static boolean |
handleRichPush(android.app.Activity pushActivity,
NetmeraJavascriptInterface javascriptInterface)
If the coming push notification is rich, the method creates a web view, adds given javascriptInterface to the web view and loads the content of the notification. |
static void |
handleRichPushWithId(android.webkit.WebView richPushWebView,
java.lang.String messageId)
Loads rich push content to the given Webview |
static boolean |
isRegistered(android.content.Context context)
Checks whether device is registered or not. |
static boolean |
isRichPush()
Gets the boolean value according to push notification type |
static void |
register(android.content.Context context,
java.lang.String senderId,
java.lang.Class<? extends android.app.Activity> pushActivityClass)
Registers device. |
static void |
register(NetmeraDeviceDetail deviceDetail)
Registers device with the given device detail information |
static void |
unregister(android.content.Context context)
Unregisters device. |
static void |
unregister(NetmeraDeviceDetail pushDeviceDetail)
Unregisters device completely. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NetmeraPushService()
Method Detail |
---|
public static void register(android.content.Context context, java.lang.String senderId, java.lang.Class<? extends android.app.Activity> pushActivityClass) throws NetmeraException
context
- application's contextsenderId
- Google Project Number of your application on Google Cloud
Services.pushActivityClass
- opening activityClass when the push notification is send. This
activity should extend NetmeraActivity
class instead
Activity
if possible.
NetmeraException
public static void register(NetmeraDeviceDetail deviceDetail) throws NetmeraException
deviceDetail
- NetmeraDeviceDetail object
NetmeraException
public static boolean isRegistered(android.content.Context context)
context
- application's context
public static java.lang.String getRegistrationId(android.content.Context context)
context
- application's context
@Deprecated public static void getDeviceGroupsInBackground(NetmeraCallback<java.util.List<java.lang.String>> callback) throws NetmeraException
callback
- NetmeraCallback.onSuccess(Object)
or
NetmeraCallback.onFail(NetmeraException)
methods
called when operation finishes.
NetmeraException
public static void getTagsInBackground(NetmeraCallback<java.util.List<java.lang.String>> callback) throws NetmeraException
callback
- NetmeraCallback.onSuccess(Object)
or
NetmeraCallback.onFail(NetmeraException)
methods
called when operation finishes.
NetmeraException
@Deprecated public static void getDeviceGroupsInBackground(int max, int page, NetmeraCallback<java.util.List<java.lang.String>> callback) throws NetmeraException
max
- The total number of results to return. If it is less than or
equal to 0 then it is set to 10.page
- The index of the page to retrieve data. If it is less than 0
then it is set to 0.callback
- NetmeraCallback.onSuccess(Object)
or
NetmeraCallback.onFail(NetmeraException)
methods
called when operation finishes.
NetmeraException
public static void getTagsInBackground(int max, int page, NetmeraCallback<java.util.List<java.lang.String>> callback) throws NetmeraException
max
- The total number of results to return. If it is less than or
equal to 0 then it is set to 10.page
- The index of the page to retrieve data. If it is less than 0
then it is set to 0.callback
- NetmeraCallback.onSuccess(Object)
or
NetmeraCallback.onFail(NetmeraException)
methods
called when operation finishes.
NetmeraException
public static void getDeviceDetailInBackground(android.content.Context context, NetmeraCallback<NetmeraDeviceDetail> callback) throws NetmeraException
context
- application's contextcallback
- NetmeraCallback.onSuccess(Object)
or
NetmeraCallback.onFail(NetmeraException)
methods
called when create operation finishes.
NetmeraException
public static void unregister(android.content.Context context)
context
- application's contextpublic static void unregister(NetmeraDeviceDetail pushDeviceDetail)
pushDeviceDetail
- NetmeraDeviceDetail objectpublic static void handleRichPushWithId(android.webkit.WebView richPushWebView, java.lang.String messageId) throws NetmeraException
richPushWebView
- WebView of registered activity class to the push notificationmessageId
- Id of the rich push content obtained from the basic push
notification
NetmeraException
- Throws exception if it cannot access serverpublic static boolean isRichPush()
public static java.lang.String getPushMessage()
public static boolean handleRichPush(android.app.Activity pushActivity) throws NetmeraException
pushActivity
- Activity class which was used while registering the device
NetmeraException
- Throws exception if it cannot access serverpublic static boolean handleRichPush(android.app.Activity pushActivity, NetmeraJavascriptInterface javascriptInterface) throws NetmeraException
pushActivity
- Activity class which was used while registering the devicejavascriptInterface
- A NetmeraJavascriptInterface
object that is injected
into created webview
NetmeraException
- Throws exception if it cannot access serverpublic static boolean handleRichPush(android.app.Activity pushActivity, java.util.List<NetmeraJavascriptInterface> javascriptInterfaces) throws NetmeraException
pushActivity
- Activity class which was used while registering the devicejavascriptInterfaces
- A list of NetmeraJavascriptInterface
objects that is
injected into created web view
NetmeraException
- Throws exception if it cannot access serverpublic static void enablePushInbox() throws NetmeraException
NetmeraException
- if your Netmera api key is missing.public static void disablePushInbox() throws NetmeraException
NetmeraException
- if your Netmera api key is missing.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |