public class MixpanelHandler extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
addDefaultProperty(String propertyName,
String propertyValue)
Properties that are added with this method will be appended to all future messages that are sent to Mixpanel.
|
static boolean |
addMessage(String eventName,
Map<String,String> properties)
Add a new message to the Mixpanel delivery queue.
|
static boolean |
sendMessages()
Send all collected messages to Mixpanel immediately.
|
static boolean |
setMilliDelay(long minMillisBetweenMessages)
Set the minimum millisecond delay between each mixpanel delivery.
|
static void |
setProjectToken(String mixpanelProjectToken)
Set the project-token that can be obtained from Mixpanel.
|
static void |
setUniqueUserID(String distinctMixpanelID)
Set a distinct ID for all Mixpanel messages sent from this application-instance.
|
static boolean |
startAutoUploader(long messageDelayMillis)
Deprecated.
|
static boolean |
stopAutoUploader(boolean force)
Deprecated.
|
@Deprecated public static boolean startAutoUploader(@Deprecated long messageDelayMillis)
Thread
that will send all messages in the queue every x seconds.messageDelayMillis - The delay in milliseconds between each send-operation.
Using a longer delay will make the Thread less responsive when stopping it again.
The delay can't be set below 1000. Smaller delays will increase network-load.Thread was started successfully, False if the Thread was already running.@Deprecated public static boolean stopAutoUploader(@Deprecated boolean force)
Thread that sends messages automatically.public static boolean sendMessages()
public static boolean addMessage(String eventName, Map<String,String> properties)
eventName - The name of the event. This will also be visible on Mixpanel.
This must not be null.properties - The properties for this message.
These will be visible and filterable on Mixpanel.public static boolean addDefaultProperty(String propertyName, String propertyValue)
propertyName - The name of the property that will be visible on Mixpanel.propertyValue - The value of the property.public static boolean setMilliDelay(long minMillisBetweenMessages)
minMillisBetweenMessages - The time in millis between each mixpanel delivery that should be sent (Min 500, Default is 5000).public static void setProjectToken(String mixpanelProjectToken)
mixpanelProjectToken - The token of you Mixpanel project.public static void setUniqueUserID(String distinctMixpanelID)
distinctMixpanelID - The distinctID that is added to each Mixpanel message.Copyright © 2022. All rights reserved.