alann-maulana / flutter_beacon

An hybrid iBeacon scanner and transmitter SDK for Flutter Android and iOS.
Apache License 2.0
118 stars 150 forks source link

How to change the frequency of the ranging scans ( iOS )? #115

Open genjm opened 2 years ago

genjm commented 2 years ago

I've got the plugin working in my app but it is returning results every second, when I only really want a very infrequent update as once the user is within a location, they are unlikely to move for quite a long period of time.

Is it possible to set the app to scan every, say, 10 minutes?

Thanks.

echb commented 2 years ago

@genjm did you was able to scan on ios device?

    if (Platform.isIOS) {
      regions.add(Region(
        identifier: 'Apple Airlocate',
        proximityUUID: '253623D3-D090-B787-1744-DDFE8B6F6D6B', // this is the uuid i want to scan right?
        minor: 1,
        major: 15,
      ));
    } else {
      regions.add(Region(identifier: 'com.beacon'));
    }

    beacons = flutterBeacon.ranging(regions)
        .listen((event) {
      inspect(event);

    });