Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support defining multiple instances by specifying instanceName in getInstance() #792

Merged
merged 2 commits into from
Jun 30, 2022

Conversation

zihejia
Copy link
Collaborator

@zihejia zihejia commented Jun 28, 2022

addresses #703. This will add the following APIs to MixpanelAPI:

/**
...
 * @param instanceName The name you want to uniquely identify the Mixpanel Instance.
   It is useful when you want more than one Mixpanel instance under the same project token.
...
**/

getInstance(Context context, String token, String instanceName)
getInstance(Context context, String token, boolean optOutTrackingDefault, String instanceName)
getInstance(Context context, String token, JSONObject superProperties, String instanceName)
getInstance(Context context, String token, boolean optOutTrackingDefault, JSONObject superProperties, String instanceName)

Please note: If you are going to add instanceName to getInstance on your existing implementation. getInstance will start using instanceName as the instance identifier rather than token, so you might lose some of the stored properties including the distinct Id under the token. We'd recommend using it when you need to create more than one instance under the same project token. You won't lose any events and user profile updates.

@zihejia zihejia force-pushed the support-multiple-instances branch from 643b16c to 9bb7fbf Compare June 29, 2022 17:28
Copy link
Collaborator

@jaredmixpanel jaredmixpanel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zihejia zihejia force-pushed the support-multiple-instances branch from 9bb7fbf to e5c3d32 Compare June 29, 2022 23:34
@zihejia zihejia merged commit 67caa99 into master Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants