mixpanel / mixpanel-swift

Official iOS (Swift) Tracking Library for Mixpanel Analytics
https://mixpanel.com
Apache License 2.0
434 stars 234 forks source link

MixpanelInstance.reset() is async and should have a completion once a new distinctId is ready. #465

Closed marcelodeaguiar closed 3 years ago

marcelodeaguiar commented 3 years ago

Calling reset on MixpanelInstance and then trying to get distinctId does not work since reset is async and add to trackingQueue. This method should have a completion once a new distinctId is ready to be used.

As a workaround I`m using

Mixpanel.mainInstance().reset()
Mixpnael.mainInstance().flush() { /* use the new distinctId here */ }
zihejia commented 3 years ago

thanks @marcelodeaguiar for bringing this up. We will address this issue.

zihejia commented 3 years ago

Hi @marcelodeaguiar , the fix is available in 2.10.3.