flutter_beacon icon indicating copy to clipboard operation
flutter_beacon copied to clipboard

BUGS IOS cannot complete scanning in second try

Open eggyot opened this issue 3 years ago • 4 comments

I try to find beacon and in first try to scanning it's work normal. after found beacon and I try to scanning again with same function, it's cannot complete and whenComplete is never execute

ADD NOTE maybe because permission in ios cannot run twice like this post? https://github.com/Baseflow/flutter-permission-handler/issues/752

List<Region> regions;
        flutterBeacon.initializeAndCheckScanning.whenComplete(() {
          regions = <Region>[];
          if (Platform.isIOS) {
            // iOS platform, at least set identifier and proximityUUID for region scanning
            regions.add(
                Region(identifier: 'BEACON', proximityUUID: proximityUUID));
          } else {
            // android platform, it can ranging out of beacon that filter all of Proximity UUID
            regions.add(Region(identifier: 'com.beacon'));
          }

          // to start ranging beacons
          _streamRanging =
              flutterBeacon.ranging(regions).listen((RangingResult result) {
            // result contains a region and list of beacons found
            // list can be empty if no matching beacons were found in range
            for (var element in result.beacons) {
              i++;
              print("minor:" +
                  element.minor.toString() +
                  ", major:" +
                  element.major.toString() +
                  ", proximityUUID:" +
                  element.proximityUUID.toString());
              if (element.proximityUUID.toString() == proximityUUID &&
                  element.major.toString() == major &&
                  element.minor.toString() == minor) {
                eventAbsen(eventId, eventName, locationName, uuid, wajibBeacon,
                    eventImages, imei);
                break;
                // flutterBeacon.ranging(regions).cancel();
              } else if (i > result.beacons.length) {
                beaconNotFound(index);
                break;
              }
            }
          });
        })

eggyot avatar Dec 09 '21 09:12 eggyot

Did you find any solution?

mokhles404 avatar Aug 01 '22 10:08 mokhles404

nope

eggyot avatar Aug 03 '22 08:08 eggyot

  1. call await flutterBeacon.initializeAndCheckScanning; once anywhere before calling any other method. ( To initialize the LocationManager)
  2. Use PR #118 for now. ( Fixes the [CoreBluetooth] XPC connection invalid )

raj457036 avatar Aug 29 '22 13:08 raj457036

any update?

devberkay avatar Nov 15 '22 11:11 devberkay