Skip to content

Commit

Permalink
update docs after merge people.identify into mixpanel.identify
Browse files Browse the repository at this point in the history
  • Loading branch information
zihejia committed Mar 17, 2022
1 parent 8611a3b commit df39030
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 22 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION_NAME=6.1.0
VERSION_NAME=6.2.0-SNAPSHOT

POM_PACKAGING=aar
GROUP=com.mixpanel.android
Expand Down
34 changes: 13 additions & 21 deletions src/main/java/com/mixpanel/android/mpmetrics/MixpanelAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,7 @@ public void setServerURL(String serverURL) {
* to the current events distinct_id, which may be the distinct_id randomly generated by the Mixpanel library
* before {@link #identify(String)} is called.
*
* <p>This call does not identify the user after. You must still call both {@link #identify(String)} and
* {@link People#identify(String)} if you wish the new alias to be used for Events and People.
* <p>This call does not identify the user after. You must still call {@link #identify(String)} if you wish the new alias to be used for Events and People.
*
* @param alias the new distinct_id that should represent original.
* @param original the old distinct_id that alias will be mapped to.
Expand Down Expand Up @@ -677,18 +676,13 @@ public JSONObject getSuperProperties() {
}

/**
* Returns the string id currently being used to uniquely identify the user associated
* with events sent using {@link #track(String, JSONObject)}. Before any calls to
* Returns the string id currently being used to uniquely identify the user. Before any calls to
* {@link #identify(String)}, this will be an id automatically generated by the library.
*
* <p>The id returned by getDistinctId is independent of the distinct id used to identify
* any People Analytics properties in Mixpanel. To read and write that identifier,
* use {@link People#identify(String)} and {@link People#getDistinctId()}.
*
* @return The distinct id associated with event tracking
* @return The distinct id that uniquely identifies the current user.
*
* @see #identify(String)
* @see People#getDistinctId()
*/
public String getDistinctId() {
return mPersistentIdentity.getEventsDistinctId();
Expand Down Expand Up @@ -1074,8 +1068,6 @@ public void optInTracking() {
*
* @param distinctId Optional string to use as the distinct ID for events.
* This will call {@link #identify(String)}.
* If you use people profiles make sure you manually call
* {@link People#identify(String)} after this method.
*
* See also {@link #optInTracking(String)}, {@link #optInTracking(String, JSONObject)} and
* {@link #optOutTracking()}.
Expand All @@ -1091,8 +1083,7 @@ public void optInTracking(String distinctId) {
*
* @param distinctId Optional string to use as the distinct ID for events.
* This will call {@link #identify(String)}.
* If you use people profiles make sure you manually call
* {@link People#identify(String)} after this method.
*
* @param properties Optional JSONObject that could be passed to add properties to the
* opt-in event that is sent to Mixpanel.
*
Expand Down Expand Up @@ -1157,10 +1148,12 @@ public boolean hasOptedOutTracking() {
*/
public interface People {
/**
* Associate future calls to {@link #set(JSONObject)}, {@link #increment(Map)},
* {@link #append(String, Object)}, etc... with a particular People Analytics user.
*
* @deprecated in 6.2.0
* NOTE: This method is deprecated. Please use {@link MixpanelAPI#identify(String)}
* instead. Associate future calls to {@link #set(JSONObject)}, {@link #increment(Map)},
* {@link #append(String, Object)}, etc... with a particular People Analytics user.
* instead.
*
* <p>All future calls to the People object will rely on this value to assign
* and increment properties. The user identification will persist across
Expand Down Expand Up @@ -1339,17 +1332,17 @@ public interface People {
/**
* Returns the string id currently being used to uniquely identify the user associated
* with events sent using {@link People#set(String, Object)} and {@link People#increment(String, double)}.
* If no calls to {@link People#identify(String)} have been made, this method will return null.
* If no calls to {@link MixpanelAPI#identify(String)} have been made, this method will return null.
*
* <p>The id returned by getDistinctId is independent of the distinct id used to identify
* any events sent with {@link MixpanelAPI#track(String, JSONObject)}. To read and write that identifier,
* use {@link MixpanelAPI#identify(String)} and {@link MixpanelAPI#getDistinctId()}.
* @deprecated in 6.2.0
* NOTE: This method is deprecated. Please use {@link MixpanelAPI#getDistinctId()} instead.
*
* @return The distinct id associated with updates to People Analytics
*
* @see People#identify(String)
* @see MixpanelAPI#getDistinctId()
*/
@Deprecated
String getDistinctId();

/**
Expand Down Expand Up @@ -1617,8 +1610,7 @@ public void identify(String distinctId) {
return;
}
if (distinctId != mPersistentIdentity.getEventsDistinctId()) {
MPLog.e(LOGTAG, "Can't identify with a distinct_id different from the one being set by MixpanelAPI.identify().");
return;
MPLog.w(LOGTAG, "Identifying with a distinct_id different from the one being set by MixpanelAPI.identify() is not recommended.");
}
identify_people(distinctId);
}
Expand Down

0 comments on commit df39030

Please sign in to comment.