public class Content
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ACTION_DISMISS_NOTIFICATION
Action for Dismiss notification Intents.
|
static java.lang.String |
ACTION_OPEN_NOTIFICATION
Action for open notification Intents.
|
static java.lang.String |
CONTENT_TYPE_CUSTOM
Content with this type can generate notifications, but otherwise is just passed through to the application.
|
static java.lang.String |
CONTENT_TYPE_SWIRL
Content with this type is presented as an interstitial web view.
|
static java.lang.String |
CONTENT_TYPE_SWIRL_URL
Content with this type is present as an interstitial web view
|
static java.lang.String |
CONTENT_TYPE_URL
Content with this type is used for deep-links back into the application or other applications.
|
static java.lang.String |
EXTRA_CONTENT
Extra for notification Intents that contains a JSON String of the raw content.
|
static java.lang.String |
EXTRA_IMPRESSION
Extra for representing the impression id.
|
| Constructor and Description |
|---|
Content(android.content.Context ctx,
android.content.Intent intent,
boolean fromNotification) |
Content(android.content.Context ctx,
org.json.JSONObject data,
Visit v,
boolean fromNotification) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
org.json.JSONObject |
getAttributes()
Get the attributes associated with this content.
|
java.lang.String |
getCustomType()
Get the custom content type associeted with this content
|
android.net.Uri |
getFallbackURL()
Get the fallback URL associated with this content.
|
java.lang.String |
getIdentifier()
Get the impression identifier associated with this content.
|
android.app.Notification |
getNotification(boolean silent,
android.graphics.Bitmap image)
Get a operating system Notification object for this content or null if
the content has no notification.
|
java.lang.String |
getNotificationText()
Gets the notification text if present
|
java.lang.String |
getNotificationTitle()
Gets the notification title if present or application label if not
|
void |
getNotificationWithImage(boolean silent,
Completion completion)
Get a operating system Notification object for this content or null if
the content has no notification.
|
android.content.Intent |
getShareIntent()
Returns an Intent suitable for using with the Android Share Widget
|
long |
getTimestamp()
Returns the milliseconds since epoch of when the content was received by the client.
|
java.lang.String |
getType()
Get the content type associated with this content.
|
android.net.Uri |
getURL()
Get the URL associated with this content.
|
Visit |
getVisit()
Get the Visit object associated with this content (if present)
|
int |
hashCode() |
boolean |
isFromNotification()
Returns whether this content was delivered via a notification interaction.
|
boolean |
isRemoteNotification()
Determine if this content was sent as a remote notification.
|
org.json.JSONObject |
toJSON()
Convert the Content object to a JSONObject
|
java.lang.String |
toString() |
public static final java.lang.String CONTENT_TYPE_CUSTOM
public static final java.lang.String CONTENT_TYPE_URL
public static final java.lang.String CONTENT_TYPE_SWIRL
public static final java.lang.String CONTENT_TYPE_SWIRL_URL
public static final java.lang.String ACTION_OPEN_NOTIFICATION
public static final java.lang.String ACTION_DISMISS_NOTIFICATION
public static final java.lang.String EXTRA_CONTENT
public static final java.lang.String EXTRA_IMPRESSION
public Content(android.content.Context ctx,
org.json.JSONObject data,
Visit v,
boolean fromNotification)
public Content(android.content.Context ctx,
android.content.Intent intent,
boolean fromNotification)
public boolean isFromNotification()
public android.content.Intent getShareIntent()
public Visit getVisit()
public java.lang.String getIdentifier()
public java.lang.String getNotificationTitle()
public java.lang.String getNotificationText()
public long getTimestamp()
public java.lang.String getType()
public boolean isRemoteNotification()
public java.lang.String getCustomType()
public android.net.Uri getURL()
public android.net.Uri getFallbackURL()
public org.json.JSONObject getAttributes()
public android.app.Notification getNotification(boolean silent,
android.graphics.Bitmap image)
silent - yes/noimage - if image present, create bigImage style, otherwise textpublic void getNotificationWithImage(boolean silent,
Completion completion)
silent - yes/nocompletion - call this completion when the notification (and assets) are readypublic org.json.JSONObject toJSON()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object