mixpanel / mixpanel-android

Official Android Tracking Library for Mixpanel Analytics
http://mixpanel.com/
Apache License 2.0
1.02k stars 366 forks source link

Allow to pass MPConfig to MixPanelAPI.getInstance() and deprecate the wrapping methods MixPanelAPI #829

Open juliocbcotta opened 6 months ago

juliocbcotta commented 6 months ago

Hello there, as we migrated to MixPanel 7.4.0, I found some issues in our code. For instance, the serverURL that we would set in the MPConfig were not being used in the library. We were able to solve this by using the MixPanelAPI wrapping methods t o access the currently used MPConfig, but not without some pain for our devs (We used MPCofing.getInstance to set the serverURL and it was hard to detect the issue) and product folks (we lost weeks of data).

I would like to recommend allowing passing a MPConfig instance to MixPanelAPI.getInstance and deprecating the methods from MixPanelAPI that just do the forwarding to the internal instance. This would expose only one proper way of setting MPConfig values.

Thank you.