Class PushContent
PushCallback#push(java.lang.String)
method to retrieve details of the push, including title, body, image URL, category, type, and metadata if available.-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanexists()Checks if there is pending push content to retrieve.static PushContentget()Gets the most recent push notification content if it exists.If the user selected an action on the push notification, then the ID of the selected action will be stored in the PushContent's actionId.getBody()Gets the body of the push content.Gets category of the push content.Gets the image URL of the push content.Gets the metadata associated with push.If the push notification action included a text field for the user to enter a response, then that response will be returned here.getTitle()Gets the title of the Push content.intgetType()Gets the type of the push content.static voidreset()Resets the push content.static voidsetActionId(String actionId) Sets the action ID of the push content.static voidSets the body of pending push content.static voidsetCategory(String category) Sets the category of the pending push content.static voidsetImageUrl(String imageUrl) Sets the image URL of pending push content.static voidsetMetaData(String metaData) Sets the metadata of pending push content.static voidsetTextResponse(String textResponse) Sets the text response for the notification.static voidSets the title of the pending push content.static voidsetType(int type) Sets the type of the push content.
-
Method Details
-
exists
public static boolean exists()Checks if there is pending push content to retrieve.
Returns
True if there is pending push content to retrieve.
-
get
Gets the most recent push notification content if it exists. This functions like Stack.pop() for a single-element stack. I.e. In addition to returning the PushContent, that push content is removed from the queue.
if (PushContent.exists()) { PushContent content = PushContent.get(); // content should be non-null PushContent content2 = PushContent.get(); // content2 should be null PushContent.exists(); // false}Returns
Pending push content if it exists.
-
reset
public static void reset()Resets the push content. After calling this,PushContent#exists()will return false. -
getTitle
Gets the title of the Push content.
Returns
the title
-
setTitle
Sets the title of the pending push content.
Parameters
title: the title to set
Deprecated
For internal use only.
-
getBody
Gets the body of the push content.
Returns
the body
-
setBody
Sets the body of pending push content.
Parameters
body: the body to set
Deprecated
For internal use only
-
getImageUrl
Gets the image URL of the push content.
Returns
the imageUrl
-
setImageUrl
Sets the image URL of pending push content.
Parameters
imageUrl: the imageUrl to set
Deprecated
For internal use only.
-
getCategory
Gets category of the push content.
Returns
the category
-
setCategory
Sets the category of the pending push content.
Parameters
category: the category to set
Deprecated
For internal use only.
-
getMetaData
Gets the metadata associated with push. This is hidden content not shown to the user.
Returns
the metaData
-
setMetaData
Sets the metadata of pending push content.
Parameters
metaData: the metaData to set
Deprecated
For internal use only.
-
getType
public int getType()Gets the type of the push content.
Returns
the type of the push content.
-
setType
public static void setType(int type) Sets the type of the push content.
Parameters
type: the type to set
Deprecated
For internal use only.
-
getActionId
If the user selected an action on the push notification, then the ID of the selected action will be stored in the PushContent's actionId. If the user did not tap an action, then this will be null.
Returns
The action ID that was selected by the user.
See also
-
PushActionsProvider
-
PushActionCategory
-
PushAction
-
-
setActionId
Sets the action ID of the push content. The action ID is only set if the user tapped on one of the actions in the push notification; and, if set, it will be set to the ID of the action that was selected.
Parameters
actionId: The ID of the action that was selected by the user.
Deprecated
For internal use only.
See also
-
PushActionsProvider
-
PushActionCategory
-
PushAction
-
getTextResponse
If the push notification action included a text field for the user to enter a response, then that response will be returned here. For notifications that don't include a response, this will return null.
Returns
The action ID that was selected by the user.
See also
-
PushActionsProvider
-
PushActionCategory
-
PushAction
-
PushAction#getTextInputButtonText()
-
PushAction#getTextInputPlaceholder()
-
-
setTextResponse
Sets the text response for the notification. Only applies to notifications where the user has entered a text response.
Deprecated
For internal use only.
See also
-
PushActionsProvider
-
PushActionCategory
-
PushAction
-
PushAction#getTextInputButtonText()
-
PushAction#getTextInputPlaceholder()
-
-