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.StringPUSH_DISMISS_ACTIONstatic java.lang.StringPUSH_TAP_ACTIONprotected intROUTING_REQUEST_CODEprotected static java.lang.StringTAP_TARGET_BUTTONprotected static java.lang.StringTAP_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.BundlebuildBundle(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap)Util method to let subclasses customize the payload through the push notification intent.protected android.os.BundlebuildBundle(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 voidbuildNotificationFromData()protected com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapActionbuildOnTap(java.lang.String onTapStr)protected com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapActionbuildOnTapFromURI(java.lang.String uriString)protected android.app.Notification.ActioncreateAction(java.lang.CharSequence title, com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String actionId, int index)protected android.app.PendingIntentcreateActionIntent(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String buttonId, java.lang.CharSequence label, int index)protected android.content.pm.ApplicationInfogetAppInfo()protected java.lang.StringgetCanonicalIdentifier()protected intgetDefaultIcon()protected com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapActiongetDefaultOnTap()protected java.lang.CharSequencegetDefaultTitle()protected android.content.IntentgetDeleteIntent()protected intgetNotificationId()protected android.content.IntentgetRoutingIntent(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap)protected android.content.IntentgetRoutingIntent(com.mixpanel.android.mpmetrics.MixpanelNotificationData.PushTapAction onTap, java.lang.String buttonId, java.lang.CharSequence label)protected booleanisValid()protected voidmaybeAddActionButtons()protected voidmaybeSetChannel()protected voidmaybeSetCustomIconColor()protected voidmaybeSetExpandableNotification()protected voidmaybeSetLargeIcon()protected voidmaybeSetNotificationBadge()protected voidmaybeSetNotificationBarIcon()protected voidmaybeSetSubText()protected voidmaybeSetTime()protected voidmaybeSetVisibility()protected voidsetBigPictureStyle(android.graphics.Bitmap imageBitmap)protected voidsetBigTextStyle(java.lang.String message)protected voidtrackCampaignReceived()
-
-
-
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()
-
-