flutter_beacon icon indicating copy to clipboard operation
flutter_beacon copied to clipboard

Foregroundservice: MissingPluginException

Open typexy opened this issue 2 years ago • 5 comments

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 avatar Sep 20 '21 20:09 typexy

@typexy Did you get a solution?

VinniciusJesus avatar Nov 24 '21 11:11 VinniciusJesus

facing the same issue when trying to initialize in isolate.

ravinandan25 avatar Jan 05 '22 08:01 ravinandan25

Do you find any hit to do this?

iles-Chester avatar Apr 01 '22 10:04 iles-Chester

I tried and faced same error. I guess this plugin doesn't support for foreground services.

barangungor avatar Apr 01 '22 11:04 barangungor

Did anyone find a solution/alternative?

S0NN1 avatar Mar 31 '23 10:03 S0NN1