Package com.mixpanel.android.mpmetrics
Class MixpanelPushNotification
- java.lang.Object
-
- com.mixpanel.android.mpmetrics.MixpanelPushNotification
-
public class MixpanelPushNotification extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
PUSH_DISMISS_ACTION
static java.lang.String
PUSH_TAP_ACTION
protected int
ROUTING_REQUEST_CODE
protected static java.lang.String
TAP_TARGET_BUTTON
protected static java.lang.String
TAP_TARGET_NOTIFICATION
-
Constructor Summary
Constructors Constructor Description MixpanelPushNotification(android.content.Context context)
MixpanelPushNotification(android.content.Context context, android.app.Notification.Builder builder, long now)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected android.os.Bundle
buildBundle(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap)
Util method to let subclasses customize the payload through the push notification intent.protected android.os.Bundle
buildBundle(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String buttonId, java.lang.CharSequence buttonLabel)
Util method to let subclasses customize the payload through the push notification intent.protected java.util.List<com.mixpanel.android.mpmetrics.MixpanelNotificationData.MixpanelNotificationButtonData>
buildButtons(java.lang.String buttonsJsonStr)
protected void
buildNotificationFromData()
protected com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction
buildOnTap(java.lang.String onTapStr)
protected com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction
buildOnTapFromURI(java.lang.String uriString)
protected android.app.Notification.Action
createAction(java.lang.CharSequence title, com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String actionId, int index)
protected android.app.PendingIntent
createActionIntent(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String buttonId, java.lang.CharSequence label, int index)
protected android.content.pm.ApplicationInfo
getAppInfo()
protected java.lang.String
getCanonicalIdentifier()
protected int
getDefaultIcon()
protected com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction
getDefaultOnTap()
protected java.lang.CharSequence
getDefaultTitle()
protected android.content.Intent
getDeleteIntent()
protected int
getNotificationId()
protected android.content.Intent
getRoutingIntent(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap)
protected android.content.Intent
getRoutingIntent(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String buttonId, java.lang.CharSequence label)
protected boolean
isValid()
protected void
maybeAddActionButtons()
protected void
maybeSetChannel()
protected void
maybeSetCustomIconColor()
protected void
maybeSetExpandableNotification()
protected void
maybeSetLargeIcon()
protected void
maybeSetNotificationBadge()
protected void
maybeSetNotificationBarIcon()
protected void
maybeSetSubText()
protected void
maybeSetTime()
protected void
maybeSetVisibility()
protected void
setBigPictureStyle(android.graphics.Bitmap imageBitmap)
protected void
setBigTextStyle(java.lang.String message)
protected void
trackCampaignReceived()
-
-
-
Field Detail
-
PUSH_TAP_ACTION
public static final java.lang.String PUSH_TAP_ACTION
- See Also:
- Constant Field Values
-
PUSH_DISMISS_ACTION
public static final java.lang.String PUSH_DISMISS_ACTION
- See Also:
- Constant Field Values
-
TAP_TARGET_BUTTON
protected static final java.lang.String TAP_TARGET_BUTTON
- See Also:
- Constant Field Values
-
TAP_TARGET_NOTIFICATION
protected static final java.lang.String TAP_TARGET_NOTIFICATION
- See Also:
- Constant Field Values
-
ROUTING_REQUEST_CODE
protected final int ROUTING_REQUEST_CODE
-
-
Method Detail
-
buildNotificationFromData
protected void buildNotificationFromData()
-
maybeSetSubText
protected void maybeSetSubText()
-
maybeSetNotificationBarIcon
protected void maybeSetNotificationBarIcon()
-
maybeSetLargeIcon
protected void maybeSetLargeIcon()
-
maybeSetExpandableNotification
protected void maybeSetExpandableNotification()
-
setBigTextStyle
protected void setBigTextStyle(java.lang.String message)
-
setBigPictureStyle
protected void setBigPictureStyle(android.graphics.Bitmap imageBitmap)
-
maybeSetCustomIconColor
protected void maybeSetCustomIconColor()
-
maybeAddActionButtons
protected void maybeAddActionButtons()
-
buildButtons
protected java.util.List<com.mixpanel.android.mpmetrics.MixpanelNotificationData.MixpanelNotificationButtonData> buildButtons(java.lang.String buttonsJsonStr)
-
buildOnTap
protected com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction buildOnTap(java.lang.String onTapStr)
-
buildOnTapFromURI
protected com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction buildOnTapFromURI(java.lang.String uriString)
-
getDefaultOnTap
protected com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction getDefaultOnTap()
-
createAction
protected android.app.Notification.Action createAction(java.lang.CharSequence title, com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String actionId, int index)
-
createActionIntent
protected android.app.PendingIntent createActionIntent(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String buttonId, java.lang.CharSequence label, int index)
-
getRoutingIntent
protected android.content.Intent getRoutingIntent(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String buttonId, java.lang.CharSequence label)
-
getRoutingIntent
protected android.content.Intent getRoutingIntent(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap)
-
getDeleteIntent
protected android.content.Intent getDeleteIntent()
-
buildBundle
protected android.os.Bundle buildBundle(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap)
Util method to let subclasses customize the payload through the push notification intent. Creates an intent to start the routing activity with a bundle describing the new intent the routing activity should launch. Uses FLAG_ACTIVITY_NO_HISTORY so that the routing activity does not appear in the back stack in Android.- Parameters:
onTap
- The PushTapAction for the intent this bundle is a member of.- Returns:
- Bundle built from onTap.
-
buildBundle
protected android.os.Bundle buildBundle(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String buttonId, java.lang.CharSequence buttonLabel)
Util method to let subclasses customize the payload through the push notification intent. Creates an intent to start the routing activity with a bundle describing the new intent the routing activity should launch. Uses FLAG_ACTIVITY_NO_HISTORY so that the routing activity does not appear in the back stack in Android.- Parameters:
onTap
- The PushTapAction for the intent this bundle is a member ofbuttonId
- The buttonId for the Notification action this bundle will be a member ofbuttonLabel
- The label for the button that will appear in the notification which this bundle will me a member of- Returns:
- Bundle built from the given input params.
-
maybeSetChannel
protected void maybeSetChannel()
-
maybeSetNotificationBadge
protected void maybeSetNotificationBadge()
-
maybeSetTime
protected void maybeSetTime()
-
maybeSetVisibility
protected void maybeSetVisibility()
-
getAppInfo
protected android.content.pm.ApplicationInfo getAppInfo()
-
getDefaultTitle
protected java.lang.CharSequence getDefaultTitle()
-
getDefaultIcon
protected int getDefaultIcon()
-
getNotificationId
protected int getNotificationId()
-
getCanonicalIdentifier
protected java.lang.String getCanonicalIdentifier()
-
isValid
protected boolean isValid()
-
trackCampaignReceived
protected void trackCampaignReceived()
-
-