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

FlutterLogs.channel.setMethodCallHandler not working with FirebaseMessaging.onBackgroundMessage on android. #82

Open
Hactieuho opened this issue Dec 16, 2024 · 0 comments

Comments

@Hactieuho
Copy link

Hactieuho commented Dec 16, 2024

if I call on main function:

    FirebaseMessaging.onBackgroundMessage((message) async {});
    FlutterLogs.channel.setMethodCallHandler((call) async {
      if (call.method == 'logsExported') {
        print(call);
      }
    });

The setMethodCallHandler never been called when I call export log function on android:
FlutterLogs.exportLogs(exportType: ExportType.ALL);

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel [user-branch], 3.22.2, on macOS 14.4.1 23E224 darwin-arm64,
    locale en-US)
    ! Flutter version 3.22.2 on channel [user-branch] at
      /Users/synodus/Downloads/flutter
      Currently on an unknown channel. Run `flutter channel` to switch to an
      official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions
      at https://flutter.dev/docs/get-started/install.
    ! Warning: `dart` on your path resolves to
      /opt/homebrew/Cellar/dart/3.0.7/libexec/bin/dart, which is not inside your
      current Flutter SDK checkout at /Users/synodus/Downloads/flutter. Consider
      adding /Users/synodus/Downloads/flutter/bin to the front of your path.
    ! Upstream repository unknown source is not a standard remote.
      Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss
      this error.
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for
      more details.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.95.2)
[✓] Connected device (4 available)
    ! Error: Browsing on the local area network for iPhone 11 xin chào. 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)
    ! Error: Browsing on the local area network for iPhone 12 Blue. 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
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

1 participant