Giter VIP home page Giter VIP logo

Comments (11)

std-s avatar std-s commented on June 30, 2024

@akashshrestha123
Hi, please provide the error information.

from open-im-sdk-flutter.

akashshrestha123 avatar akashshrestha123 commented on June 30, 2024

Hey @std-s thank you so much for your response. I don't any kinds of error logs. since i have few question .
Urgent: OpenIM Listener Callbacks Not Triggering in Embedded Flutter App

We are encountering a critical issue with the OpenIM Flutter SDK not triggering listener callbacks when integrated into our existing Flutter application.

Key Points:

  • Environment:
    • Flutter Version: 3.0.2
    • OpenIM Flutter SDK: 3.5.1
    • Additional relevant dependencies: Firebase, go_router, provider, etc.
  • Successful Connection: We can confirm from native logs that the onConnectSuccess event is successfully triggered on the native side (both Android and iOS).
  • Listener Not Called: However, the corresponding listener callbacks defined in our Flutter code are not being executed.
  • Standalone Works: We have tested the OpenIM SDK in a minimal, standalone Flutter app, and the listener callbacks work as expected in that environment.

Steps Taken:

  • Verified that method channel names match exactly between Flutter and native code.
  • Ensured listener registration happens before or during initSDK.
  • Made the listener a class member to avoid garbage collection.
  • Used scheduleTask for Android to ensure callbacks on the main thread.
  • Checked for conflicting plugins or dependencies by temporarily disabling them.
  • Verified the correctness of initSDK parameters.

Request to OpenIM Team:

  1. Are there any known compatibility issues: Specifically between the OpenIM Flutter SDK v3.5.1 and our Flutter version (3.0.2) or other dependencies we are using?

  2. Specific Configuration for Embedded Apps: Are there any special configuration settings or steps required when embedding the OpenIM SDK within an existing Flutter app (as opposed to a standalone app)?

  3. Possible Conflicts: Could there be potential conflicts between the OpenIM SDK and other libraries or components commonly used in Flutter apps, such as Firebase or go_router?

  4. Debugging Recommendations: Could you provide more guidance on how to further debug this issue? Are there specific logs or areas in the native code that we should focus on to identify the problem?

  5. Alternative Solutions: Are there any alternative approaches or workarounds you recommend for handling listener callbacks when embedding the OpenIM SDK in a complex Flutter app?

Additional Notes:

  • We are not seeing any error messages in the Flutter console or native logs related to the OpenIM SDK initialization or connection.
  • We have also tried clearing the Flutter cache, rebuilding the project, and restarting the IDE, but the issue persists.

We would greatly appreciate any assistance you can provide in resolving this issue. Please let us know if you need any further information or code snippets to help you diagnose the problem.

from open-im-sdk-flutter.

std-s avatar std-s commented on June 30, 2024

@akashshrestha123 hi, Have you set up a listener? Something like this.

from open-im-sdk-flutter.

akashshrestha123 avatar akashshrestha123 commented on June 30, 2024

@std-s Yeah exactly i did. when i create simple app doing this all it is working correctly calling every listener method in flutter side but when integrate in my existing e-learning app only "onConnecting" is called in flutter side after that nothing is called in flutter side but when i see logger that is came from native side every listener method is calling properly.

from open-im-sdk-flutter.

cipchk avatar cipchk commented on June 30, 2024

I have the exact same situation, but my iOS works fine. However, on Android, only onConnecting and onConnectSuccess are triggered, and none of the other event listeners are triggered at all.

We can obtain the following logs, but we are unable to trigger Flutter's listening events.

I/F-OpenIMSDK(flutter call native)(19498): { class:conversationManager,  method:setConversationEx }
I/F-OpenIMSDK(flutter call native)(19498): { class:conversationManager,  method:getConversationListSplit }
I/F-OpenIMSDK(flutter call native)(19498): { class:conversationManager,  method:setConversationEx }

Doctor -v:

[✓] Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-x64, locale zh-Hans-CN)
    • Flutter version 3.22.1 on channel stable at /Users/cipchk/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14f74ff3a (4 weeks ago), 2024-05-22 11:08:21 -0500
    • Engine revision 55eae6864b
    • Dart version 3.4.1
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/cipchk/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/cipchk/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/cipchk/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.90.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.90.0

[✓] Connected device (3 available)
    • SM G996U (mobile) • RFCNC0J4X2J • android-arm64  • Android 14 (API 34)
    • macOS (desktop)   • macos       • darwin-x64     • macOS 14.5 23F79 darwin-x64
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 126.0.6478.63
    ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!
```[✓] Flutter (Channel stable, 3.22.1, on macOS 14.5 23F79 darwin-x64, locale zh-Hans-CN)
    • Flutter version 3.22.1 on channel stable at /Users/cipchk/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision a14f74ff3a (4 weeks ago), 2024-05-22 11:08:21 -0500
    • Engine revision 55eae6864b
    • Dart version 3.4.1
    • DevTools version 2.34.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/cipchk/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/cipchk/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/cipchk/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.14.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 17.0.9+0-17.0.9b1087.7-11185874)

[✓] VS Code (version 1.90.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.90.0

[✓] Connected device (3 available)
    • SM G996U (mobile) • RFCNC0J4X2J • android-arm64  • Android 14 (API 34)
    • macOS (desktop)   • macos       • darwin-x64     • macOS 14.5 23F79 darwin-x64
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 126.0.6478.63
    ! Error: Browsing on the local area network for iPhone. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources
    • All expected network resources are available.

• No issues found!

from open-im-sdk-flutter.

std-s avatar std-s commented on June 30, 2024

@akashshrestha123 @cipchk
Hi, the main steps are to initialize the SDK, set the listener, and log in. This file shows the functions of initializing the SDK and setting the listener. You can run our open source Demo first.

from open-im-sdk-flutter.

cipchk avatar cipchk commented on June 30, 2024

@std-s My test phone is a Samsung. How about you? @akashshrestha123

Other than Samsung (Galaxy S21+ 5G), I have tested brands like Xiaomi and Huawei, and everything works fine.

from open-im-sdk-flutter.

akashshrestha123 avatar akashshrestha123 commented on June 30, 2024

@cipchk mine also samsung galaxy a50. and are you sure it is working in xiaomi and huawei. are you creating simple or integrating in existing project?

from open-im-sdk-flutter.

akashshrestha123 avatar akashshrestha123 commented on June 30, 2024

@std-s is it something with flutter version also? since i am at flutter version 3.0.2. When i create simple app or creating new project every single listener and every thing is working correctly. Since i have a little heavy application that is e-learning and has a lot of package used. Did i miss something? Does it also depends on how our flutter project is structured?

from open-im-sdk-flutter.

cipchk avatar cipchk commented on June 30, 2024

@akashshrestha123 Yes, my Samsung device is similar to yours. Since we need to launch on Google Play, the minimum build version required is 30 or above. However, the official version provided is 26, so I feel the issue might be with the build version. I don't have the means to test this on my end; could you possibly conduct some tests on the build level? I believe it is indeed a build issue.

Here is the #136 (comment) with my Flutter environment, which also includes the Android part:

  • compileSdkVersion 34
  • minSdkVersion 23
  • targetSdkVersion flutter.targetSdkVersion

from open-im-sdk-flutter.

cipchk avatar cipchk commented on June 30, 2024

@akashshrestha123 Any progress?

from open-im-sdk-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.