davide-scalzo / react-native-mixpanel

A React Native wrapper for Mixpanel tracking
MIT License
455 stars 195 forks source link

getDistinct ID Undefined #226

Open bpfeiffer187 opened 4 years ago

bpfeiffer187 commented 4 years ago

Trying to get at the out of the Mixpanel Distinct ID to create a varible that can then be passed to other functions.

the function below returns undefined, but i have already had a different mixpanel event fire prior to this. Any thoughts?

const getMPID = () => { Mixpanel.sharedInstanceWithToken(mixpanelToken()).then(() => { Mixpanel.getDistinctId((id: any) => { Mixpanel.identify(id); }); }); };