Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGS IOS cannot complete scanning in second try #108

Open
eggyot opened this issue Dec 9, 2021 · 4 comments · May be fixed by #118
Open

BUGS IOS cannot complete scanning in second try #108

eggyot opened this issue Dec 9, 2021 · 4 comments · May be fixed by #118

Comments

@eggyot
Copy link

eggyot commented Dec 9, 2021

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? Baseflow/flutter-permission-handler#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 eggyot changed the title ios cannot complete scanning in second try BUGS IOS cannot complete scanning in second try Dec 22, 2021
@mokhles404
Copy link

Did you find any solution?

@eggyot
Copy link
Author

eggyot commented Aug 3, 2022

nope

raj457036 added a commit to raj457036/flutter_beacon that referenced this issue Aug 29, 2022
Added altbeacon in scanner along with ibeacon.
@raj457036
Copy link

  1. call await flutterBeacon.initializeAndCheckScanning; once anywhere before calling any other method. ( To initialize the LocationManager)
  2. Use PR fixes #108 and also added support alt beacon layout. #118 for now. ( Fixes the [CoreBluetooth] XPC connection invalid )

@devberkay
Copy link

any update?

danaodai951 added a commit to danaodai951/flutter_beacon that referenced this issue Aug 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants