Flutter uses a flexible system that allows you to call platform-specific APIs whether available in Kotlin or Java code on Android, or in Swift or Objective-C code on iOS. A named channel for communicating with platform plugins using asynchronous method calls.
Questions tagged [flutter-method-channel]
146 questions
44
votes
3 answers
Flutter- FCM A background message could not be handled in Dart as no onBackgroundMessage handler has been registered
I wanted to handle the background message of the FCM in the Flutter, but I got an error when FCM sent a message to the app in the background mode and made an error in the log.
pubspec.yaml:
firebase_core: ^0.7.0
firebase_messaging:…

Taleb
- 1,944
- 2
- 11
- 36
8
votes
2 answers
Flutter: Using path provider when app is in background
I am currently trying to implement FCM and local notifications into my Flutter app. I have successfully configured FCM and the Local notifications for normal notifications, But i also have a different type of notification that I would like to…

barbecu
- 684
- 10
- 28
7
votes
2 answers
How to use Flutter Method Channel in background (app minimised/closed)
I am working on a native Android widget in a Flutter App. In which there is refresh button, on click of that I have to call a method in the Flutter code. I am using Flutter Method Channel for the communication and it is working fine when app is in…

Shahbaz Hashmi
- 2,631
- 2
- 26
- 49
6
votes
1 answer
How to listen a startActivityForResult call when using FlutterPlugin?
I'm developing a Flutter Plugin for Android using Java. When i call the MethodChannel, I need to call another Android Intent. If I was using an native activity, it would be simple since I can call startActivityForResult and implement the method…

empiresdev
- 153
- 1
- 7
6
votes
1 answer
Flutter: how can I permanently register a sensor (and never unregister it?)
TL;DR how can I have an Android sensor permanently running/active/registered for my app, even if I close it?
Objective:
I'm making a Flutter application that counts your steps using the pedometer package,
which uses the built-in sensor…

Cedric
- 470
- 6
- 20
5
votes
1 answer
Unable to start Activity from onBackgroundMessage
Just created a new Flutter app
Ultimately trying to open my app or show a full screen Activity when I receive a notification (think phone call)
Currently just trying to console log in a native class called through the background message…

baconcheese113
- 843
- 2
- 13
- 27
4
votes
1 answer
Whats the difference between writing MethodChannel bridge versus dart:ffi bridge to run c/c++ code to get the response?
Before I start my question I want to point out that it's not similar this question.
Difference between writing platform specific code vs dart:ffi code. Here the questioner is asking the actual difference whereas I am trying to know the difference…

Aawaz Gyawali
- 3,244
- 5
- 28
- 48
3
votes
2 answers
Methodchannel is not calling from background service onStart in flutter
I want to fetch data from native side to flutter in background service call. I have implemented flutter_background_service to work with foreground and background tasks at flutter side.
@pragma('vm:entry-point')
void onStart(ServiceInstance service)…

Shriya Pandya
- 404
- 3
- 12
3
votes
0 answers
How to make a method channel call on a vm-entry-point instance?
I'm developing a flutter application that has some native codes, that is, I use the channel to retrieve some native resources, so far my application works fine, but when using libs to have a floating window in any part of the system I need to use…

Rogers Marques
- 53
- 1
- 8
3
votes
1 answer
Android:Get audio metadata from URI
Aim:
I have created a music player using flutter. And I want to play audio files from another app.
For this purpose, I have used method channel for communication between flutter and Android.And I am getting the below URI from Intent.
Received…

Ruchit Soni
- 166
- 5
3
votes
1 answer
Add delegate to custom iOS Flutter Plugin
I'm working on integrating a custom iOS plugin into my Flutter app, problem is that I'm not getting delegate callbacks from the custom SDK Protocol.
I have to connect a bluetooth device to my app and I from the delegate calls I should receive the…

Jorge Rincón Arias
- 31
- 1
3
votes
0 answers
How to invoke method channel from Workmanager task
I have a method channel registered in the Android build's MainActivity class, which works fine when called from the foreground application.
I want to call this method channel from a task that Workmanager runs in the background, but I'm getting a…

Julian
- 105
- 1
- 5
3
votes
0 answers
Unhandled Exception: MissingPluginException(No implementation found for method mymethod on channel com.izan.abc) on Android
I followed this tutorial to integrate a Flutter module to an existing native Android app (host) which worked perfectly fine. I then tried to pass values from the host app to the Flutter module and followed this.
Host app
startActivity(
…

Izan Majeed
- 49
- 10
3
votes
0 answers
Flutter Exception caught by gesture: a ticker was started twice
I have a Flutter application that communicates with the android native code through EventChannel and MethodChannel in order to start or stop an SDK and listen and display in the Flutter Ui the event generated by the SDK.
Everything work fine until I…

TheOldBlackbeard
- 395
- 4
- 22
3
votes
0 answers
How to create a channel from Android Service to Flutter function?
I'm trying to create a channel between Flutter and Android.
I have this code inside MainActivity and this channel just works fine when called from FLutter code.
setMethodCallHandler { call, result ->
Log.d("configureFlutterEngine",…

Vishak A Kamath
- 117
- 14