Giter Site home page Giter Site logo

Comments (2)

RicharC293 avatar RicharC293 commented on July 20, 2024 1

Sometimes when i call getSessionId() return session id but in other cases return -1
Flutter doctor -v
[√] Flutter (Channel stable, 2.5.0, on Microsoft Windows [Versión 10.0.19042.1237], locale es-EC)
• Flutter version 2.5.0 at C:\src\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 4cc385b4b8 (13 days ago), 2021-09-07 23:01:49 -0700
• Engine revision f0826da7ef
• Dart version 2.14.0

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\tipti\AppData\Local\Android\Sdk
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = C:\Users\tipti\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] VS Code (version 1.60.1)
• VS Code at C:\Users\tipti\AppData\Local\Programs\Microsoft VS Code
• Flutter extension can be installed from:
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
• LM X525 (mobile) • LMX525USUKZP5D9PE6 • android-arm • Android 10 (API 29)
• Chrome (web) • chrome • web-javascript • Google Chrome 93.0.4577.82
• Edge (web) • edge • web-javascript • Microsoft Edge 93.0.961.52

• No issues found!

Amplitude Version amplitude_flutter 3.3.0
Flutter Segment flutter_segment 3.1.2

Code to call session_id implemented

static Future<int> _getAmplitudeSessionId(User user) async {
    try {
      final Amplitude analytics =
          Amplitude.getInstance(instanceName: "client_mobile");
      analytics.setUseDynamicConfig(true);
      analytics.setServerUrl("https://api2.amplitude.com");
      analytics.init(Flavor.amplitude, userId: "${user.userId}");
      analytics.trackingSessionEvents(true);
      print(await analytics.getSessionId());
      return await analytics.getSessionId();
    } catch (err) {
      debugPrint("INITIALIZE_AMPLITUDE: $err");
      return null;
    }
  }

from amplitude-flutter.

yuhao900914 avatar yuhao900914 commented on July 20, 2024

Hi @RicharC293. Does the issue is when you trying to get session id from amplitude_flutter the session id always be -1? Without the implementation details, we cannot find the real cause is. May I know which version of amplitude_flutter you are using and how you get the session id?

from amplitude-flutter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.