umair13adil / simple_beacons_flutter

A flutter plugin project to range & monitor iBeacons.
Apache License 2.0
35 stars 42 forks source link

setMethodCallHandler never run? #61

Open barangungor opened 2 years ago

barangungor commented 2 years ago

I want scan beacon devices, wrote the code like example code but i only see 2. print in my console. I can't see 3. print and can't startMonitoring.

    if (Platform.isAndroid) {
      //Prominent disclosure
      print('HELLO ANDROID');
      await BeaconsPlugin.setDisclosureDialogMessage(
              title: "Title",
              message:
                  "Message")
          .then((value) {
        print('HELLO ANDROID 2');
      });
      // await BeaconsPlugin.clearDisclosureDialogShowFlag(false);
      BeaconsPlugin.channel.setMethodCallHandler((call) async {
        print("Method: ${call.method}");
        if (call.method == 'scannerReady') {
          await BeaconsPlugin.startMonitoring();
        } else if (call.method == 'isPermissionDialogShown') {
          print("Prominent disclosure message is shown to the user!");
        }
      });
    } 
francescovallone commented 1 year ago

Hello,

Same problem here running the example app. It never print print("Method: ${call.method}"); so it looks like it's not working properly