flutter_beacon
flutter_beacon copied to clipboard
Foregroundservice: MissingPluginException
When trying to execute
flutterBeacon.initializeScanning
from a foreground service function, an exception is thrown:
_Unhandled Exception: MissingPluginException(No implementation found for method initialize on channel flutter_beacon)
#0 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:154:7)
#1 FlutterBeacon.initializeScanning (package:flutter_beacon/flutter_beacon.dart:60:20)
Is this an issue on my side, or is this package not suitable for foreground services, @alann-maulana ?
The foreground service package I'm using, is android_long_task (0.4.7) and flutter_beacon (0.5.1) with flutter version 2.5.1
The code snippet is the following:
@pragma('vm:entry-point')
serviceMain() async {
ServiceClient.setExecutionCallback((initialData) async {
if (Platform.isAndroid) {
await flutterBeacon.initializeScanning;
}
}
@typexy Did you get a solution?
facing the same issue when trying to initialize in isolate.
Do you find any hit to do this?
I tried and faced same error. I guess this plugin doesn't support for foreground services.
Did anyone find a solution/alternative?