Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue after updating to v1.1.0 #24

Open
diego-paired opened this issue Apr 30, 2023 · 1 comment
Open

Issue after updating to v1.1.0 #24

diego-paired opened this issue Apr 30, 2023 · 1 comment

Comments

@diego-paired
Copy link

When updating the experiments SDK from 1.0.0 to 1.1.0, the following error is observed:
ERROR Timed out waiting for Amplitude Analytics SDK to initialize. You must ensure that the analytics SDK is initialized prior to calling fetch().

Note that this is using the SDK along with @amplitude/react-native@2.17.0

Initialisation code:

  amplitude = Amplitude.getInstance();
  await amplitude.setServerUrl(AMPLITUDE_PROXY);
  await amplitude.init(AMPLITUDE_KEY);

  // Amplitude Experiments

  experiments = Experiment.initializeWithAmplitudeAnalytics(
    AMPLITUDE_EXPERIMENT_KEY,
    {
      automaticExposureTracking: false,
      serverUrl: EXPERIMENTS_PROXY,
    },
  );

Reverting back to version 1.0.0 makes the error go away.

Thanks in advance.

@bgiori
Copy link
Contributor

bgiori commented Apr 30, 2023

Hey Diego, thanks for reporting this.

The issue you've reported is actually a bug fix. This SDK's integration only works with the new React Native analytics SDK, not the old SDK.

The bug made it so code used to wait for the analytics SDK to complete initialization was not being called. The fix now calls the function to wait for the analytics SDK to complete init and set user identity before calling fetch.

You have two options:

  1. Use the base initialize() method to init the experiment SDK. This will maintain no integration between the experiment and analytics SDKs
  2. Migrate to use the newer react-native SDK, in which case the integration will work and identity should be passed between the SDKs.

If you have any questions please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants