Segment doesn’t appear to be working at all—I’m following the instructions from the documentation. I wrapped my initialize
call in its own function to use the appropriate write keys based on environment. We don’t have android write keys, so I’ve tried skipping the key entirely, passing an empty string, and passing in the write key for a different unrelated source. None of them seem to have any effect. I’ve tested that the function is called, but initialize doesn’t seem to do anything. I don’t see any network requests going out to segment for calls to identify or track.
Any ideas? Seems like others are having the same issues.
setup
- Call initAnalytics in the
init
redux action we’re firing on app startup - Call
identify
onlogin success
andtrack
@@AUTH/LOGIN/SUCCESS
utils/analytics.js
function initAnalytics() {
if (__DEV__) {
console.log('initializing segment for dev');
return Segment.initialize({ androidWriteKey: '', iosWriteKey: 'xxxyyyzzz...' });
}
return Segment.initialize({ androidWriteKey: '', iosWriteKey: 'zzzzzzyyy...' });
}
Project dependencies:
expo: 25.0.0
react-native: https://github.com/expo/react-native/archive/sdk-25.0.0.tar.gz