public class ContentManager extends Manager
| Modifier and Type | Class and Description |
|---|---|
class |
ContentManager.ContentEvent
ContentEvent is the base class for all content events.
|
class |
ContentManager.ReceiveContentCustomEvent
This event is sent when content of type Custom is received.
|
class |
ContentManager.ReceiveContentURLEvent
This event is sent when content of type URL is received.
|
class |
ContentManager.ReceiveContentViewEvent
This event is sent when content of type Swirl is received.
|
| Modifier and Type | Field and Description |
|---|---|
protected ContentView |
contentView |
protected android.content.Context |
context |
static java.lang.String |
EVENT_IMPRESSION_1
These events are for user-defined reporting
|
static java.lang.String |
EVENT_IMPRESSION_10 |
static java.lang.String |
EVENT_IMPRESSION_2 |
static java.lang.String |
EVENT_IMPRESSION_3 |
static java.lang.String |
EVENT_IMPRESSION_4 |
static java.lang.String |
EVENT_IMPRESSION_5 |
static java.lang.String |
EVENT_IMPRESSION_6 |
static java.lang.String |
EVENT_IMPRESSION_7 |
static java.lang.String |
EVENT_IMPRESSION_8 |
static java.lang.String |
EVENT_IMPRESSION_9 |
static java.lang.String |
EVENT_IMPRESSION_OFFER_REDEEMED
This event is added to the log stream when an offer is redeeemed.
|
static java.lang.String |
EVENT_IMPRESSION_REJECTED
This event is added to the log stream when an impression is rejected via the override
shouldShowContent.
|
static java.lang.String |
EVENT_IMPRESSION_SAVED
This event is added to the log stream when an impression is saved.
|
static java.lang.String |
EVENT_IMPRESSION_SHARED
This event is added to the log stream when an impression is shared.
|
static java.lang.String |
EVENT_IMPRESSION_TAP_AREA
This event is added to the log stream when a tap area is hit
|
static java.lang.String |
EVENT_IMPRESSION_TIMEOUT
This event is added to the log stream when a presentation is rejected by the application
due to being too old (stale).
|
static java.lang.String |
EVENT_IMPRESSION_TOUCHED
This event is added to the log stream whena n impression is touched.
|
static java.lang.String |
EVENT_IMPRESSION_VIEWED
This event is added to the log stream when an impressions is viewed.
|
static java.lang.String |
EVENT_IMPRESSION_VIEWED_MINIMIZED
This event is added to the log stream when an impressions is viewed using alternate layout
|
static java.lang.String |
EVENT_IMPRESSION_WALLET_REDEEMED
This event is added to the log stream when a wallet item is redeeemed
|
static java.lang.String |
EVENT_NOTIFICATION_ABSENT
This event is added to the log stream when content does not contain a notification.
|
static java.lang.String |
EVENT_NOTIFICATION_DISABLE
This event is added to the log stream when notifications are disabled.
|
static java.lang.String |
EVENT_NOTIFICATION_DISMISS
This event is added to the log stream when a notification is dismissed.
|
static java.lang.String |
EVENT_NOTIFICATION_OPEN
This event is added to the log stream when a notification is opened.
|
static java.lang.String |
EVENT_NOTIFICATION_SENT
This event is added to the log stream when a notification is sent without any of the
othe qualifications.
|
static java.lang.String |
EVENT_NOTIFICATION_SENT_BLOCKED
This event is added to the log stream when a notification is present, but the user
has blocked notifications.
|
static java.lang.String |
EVENT_NOTIFICATION_SENT_NOSOUND
This event is added to the log stream when a notification is present, but the user has
disallowed sound (or vibration) for notifications.
|
static java.lang.String |
EVENT_NOTIFICATION_TIMEOUT
This event is added to the log stream when a notification is rejected by the application
due to being too old (stale).
|
static java.lang.String |
EVENT_NOTIFICATON_REJECTED
This event is added to the log stream when a notification is rejected by the application
via the shouldShowNotification override.
|
| Constructor and Description |
|---|
ContentManager(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
ContentView |
getContentView()
Returns the default ContentView.
|
static ContentManager |
getInstance()
Returns the last ContentManager created.
|
Content |
getLastContent()
Returns the last content received, regardless of whether it has been shown or not.
|
Content |
getLastShown()
Returns the last content shown (in this session)
|
void |
handleURLIntent(android.content.Intent intent)
Called to handle an URL Intent
Default implementation is context.startActivity(intent)
|
protected void |
handleViewIntent(android.content.Intent intent)
Called to handle a view activity intent
Default implementation is context.startActivity(intent)
|
protected android.content.Intent |
intentForContent(Content content) |
protected android.content.Intent |
intentForContentActivity(android.content.Context context)
Called before starting the ContentActivity to proved an opportunity to subclass
the default ContentActivity.
|
protected void |
notifyForContent(Content content)
Called to display a notification for content.
|
void |
onBeginVisit(VisitManager.BeginVisitEvent event)
This method is public for technical reasons.
|
void |
onDwellVisit(VisitManager.DwellVisitEvent event)
This method is public for technical reasons.
|
void |
onEndVisit(VisitManager.EndVisitEvent event)
This method is public for technical reasons.
|
void |
onForeground(Swirl.ForegroundEvent event)
This method is public for technical reasons.
|
void |
onIntent(android.content.Intent intent)
This method is public for technical reasons.
|
void |
onReceiveContent(Content content) |
protected void |
onReceiveContentCustom(Content content)
Called when content of type Custom is received.
|
protected void |
onReceiveContentURL(Content content)
Called when content of type URL is received.
|
protected void |
onReceiveContentView(Content content)
Called when content of type Swirl is received.
|
void |
requestContentPreview(java.lang.String previewCode,
SafeRunnable completion)
Force a request for content with a preview code.
|
protected void |
shouldNotifyForContent(Content content,
Completion completion)
Called before a notification is generated (async).
|
protected boolean |
shouldNotifyForContent(Content content,
android.app.Notification notification)
Called before a notification is presented.
|
protected boolean |
shouldStartContentURLActivity(Content content,
android.content.Intent intent)
Called before CONTENT_TYPE_URL content is activated.
|
protected boolean |
shouldStartContentViewActivity(Content content,
android.content.Intent intent)
Called before CONTENT_TYPE_SWIRL content is activated.
|
void |
showToastForContent(Content content) |
void |
start()
Starts the manager.
|
void |
startContentViewActivity()
Forces the a call to startActivity on the ContentActivity.
|
void |
stop()
Stops the manager.
|
public static final java.lang.String EVENT_NOTIFICATION_DISABLE
public static final java.lang.String EVENT_NOTIFICATION_ABSENT
public static final java.lang.String EVENT_NOTIFICATON_REJECTED
public static final java.lang.String EVENT_NOTIFICATION_TIMEOUT
public static final java.lang.String EVENT_NOTIFICATION_SENT_BLOCKED
public static final java.lang.String EVENT_NOTIFICATION_SENT_NOSOUND
public static final java.lang.String EVENT_NOTIFICATION_SENT
public static final java.lang.String EVENT_NOTIFICATION_OPEN
public static final java.lang.String EVENT_NOTIFICATION_DISMISS
public static final java.lang.String EVENT_IMPRESSION_VIEWED
public static final java.lang.String EVENT_IMPRESSION_VIEWED_MINIMIZED
public static final java.lang.String EVENT_IMPRESSION_REJECTED
public static final java.lang.String EVENT_IMPRESSION_SHARED
public static final java.lang.String EVENT_IMPRESSION_TIMEOUT
public static final java.lang.String EVENT_IMPRESSION_SAVED
public static final java.lang.String EVENT_IMPRESSION_TOUCHED
public static final java.lang.String EVENT_IMPRESSION_OFFER_REDEEMED
public static final java.lang.String EVENT_IMPRESSION_WALLET_REDEEMED
public static final java.lang.String EVENT_IMPRESSION_TAP_AREA
public static final java.lang.String EVENT_IMPRESSION_1
public static final java.lang.String EVENT_IMPRESSION_2
public static final java.lang.String EVENT_IMPRESSION_3
public static final java.lang.String EVENT_IMPRESSION_4
public static final java.lang.String EVENT_IMPRESSION_5
public static final java.lang.String EVENT_IMPRESSION_6
public static final java.lang.String EVENT_IMPRESSION_7
public static final java.lang.String EVENT_IMPRESSION_8
public static final java.lang.String EVENT_IMPRESSION_9
public static final java.lang.String EVENT_IMPRESSION_10
protected android.content.Context context
protected ContentView contentView
public static ContentManager getInstance()
public void start()
Managerpublic void stop()
Managerpublic void showToastForContent(Content content)
public ContentView getContentView()
public ContentView getContentView() {
return (contentView != null ? contentView : (contentView = new ContentView(context)));
}
public Content getLastContent()
public Content getLastShown()
public void handleURLIntent(android.content.Intent intent)
intent - the URL intent to startprotected boolean shouldStartContentURLActivity(Content content, android.content.Intent intent)
content - The content containing the URL and fallbackURLintent - An intent based on that contentprotected void handleViewIntent(android.content.Intent intent)
intent - the intent to start the content viewprotected boolean shouldStartContentViewActivity(Content content, android.content.Intent intent)
content - The content containing an URL to a html interstitialintent - An intent based on that contentprotected android.content.Intent intentForContentActivity(android.content.Context context)
context - Context to userprotected android.content.Intent intentForContent(Content content)
public void startContentViewActivity()
protected boolean shouldNotifyForContent(Content content, android.app.Notification notification)
content - The content containing an URL to a html interstitialnotification - The notification constructed from the content.protected void shouldNotifyForContent(Content content, Completion completion)
content - The content containing the notificationcompletion - The completion object to call when processing is doneprotected void notifyForContent(Content content)
content - protected void onReceiveContentURL(Content content)
content - The content that was received.protected void onReceiveContentView(Content content)
content - The content that was received.protected void onReceiveContentCustom(Content content)
content - The content that was received.public void onReceiveContent(Content content)
public void requestContentPreview(java.lang.String previewCode,
SafeRunnable completion)
previewCode - preview code retrieved from the platformcompletion - optional completion that is called when the content request completes.public void onForeground(Swirl.ForegroundEvent event)
event - The dispatched event.public void onIntent(android.content.Intent intent)
intent - The dispatched event.public void onBeginVisit(VisitManager.BeginVisitEvent event)
event - The dispatched event.public void onDwellVisit(VisitManager.DwellVisitEvent event)
event - The dispatched event.public void onEndVisit(VisitManager.EndVisitEvent event)
event - The dispatched event.