Segment issues (expo 25.0.0)

#1

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 on login success and track @@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

#2

Ping. Anyone have any input?

#3

Segment is only expected to work correctly in standalone builds. Are you trying to test through the Expo client?

closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.