mixpanel / mixpanel-android

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

How do you set com.mixpanel.android.MPConfig.EventsEndpoint at runtime #730

Closed dl748 closed 3 years ago

dl748 commented 3 years ago

mixpanel-swift has a function called setServerURL but the android sdk does not provide such a method, is there a way to dynamically set this at runtime?

zihejia commented 3 years ago

hi @dl748 , yes, please refer to this doc https://developer.mixpanel.com/docs/self-hosted-tracking in the Android SDK section.

dl748 commented 3 years ago

No, those instructions set the variable at COMPILE time, which is completely different.

my "PROXY_DOMAIN" is variable and can dynamically change AFTER the build process.

MIXPANEL-SWIFT allows me to set that via setServerURL, the WEB allows me to set that via the init parameters, but the MIXPANEL-ANDROID seems to provide no such documented feature.

You cannot set the AndroidManifest.xml at runtime.

zihejia commented 3 years ago

hi @dl748 , sorry about that. We will consider providing it in the next couple of versions.

zihejia commented 3 years ago

hi @dl748 , we just released 5.9.0, now you can use setServerURL to set it in the run time. I'm closing it now, please feel free to reopen it if you find any issues in this API.