Open bobhuang1 opened 8 years ago
Hello,
I am struggling with the same behaviour that seems to be based on on the "background-optimization" in Android 7.
Is there any solution so far?
Oliver
No solution yet, I have to disable plugin on Android 7 phones for now.
The only workaround I can see momentarily is to set the ForegroundBetweenScanPeriod accordingly in config.xml
preference name="com.unarin.cordova.beacon.android.altbeacon.ForegroundBetweenScanPeriod" value="5000"
The disadvantage of this approach is that we get updates on the sorrounding beacons now only every 5 seconds. In my case where I am developing an app to be used within a museums exhibition where a couple of beacons are pleced to determine where the visitor is located and trigger according events for the specific location it means that within this 5 seconds a couple of beacons may be passed by the visitor without the app noticing that ... Very bad :-(
@bobhuang1 Where / how did you get the updated JAR file? I would like to test this out but I'm not sure how to generate a JAR file.
@omanthey What config.xml file are you referring too?
@parkej60: I#m referring to the cordoca projetx main config.xml. There you can configure the ForegroundBetweenScanPeriod. I configured this originally to a value of 1000ms so I got BLE Beacon values every second. But with the changes in Android 7 only 6 times in 30 seconds the underlying BLE System can becalled (every further call will be blocked). so I mofdified the value to 5000 ms to hit the 30 sec. interval. This way my system works (beacon installation to lead visitors through a museums exhibition) but it is much less responsive. Within 6 seconds a visitor may procced so far that individual beacons will be ignored :-(
I still hope there will be some solutiuon for this problem in the future ...
Ok. After adjusting the power on the beacons I'm now seeing the exact same issue as documented above. Works well on Android 6.0, but seeing the toggling in and out of regions when in Android 7.0
@parkej60 Sorry I have not checked this page for while, I downloaded the latest jar from: http://altbeacon.github.io/android-beacon-library/download.html I also tried downloading the source and compile myself: https://github.com/AltBeacon/android-beacon-library Always the same issue. However as @omanthey pointed out, setting ForegroundBetweenScanPeriod to 5000ms works but much less responsive. I guess that's something we have to live with on Android 7.
I have an idea, is it possible to set ForegroundBetweenScanPeriod to 5000ms when android is 7.0 and to the default 1000ms when it's not? Does the config.xml platform section allow specifying os version? Thanks.
Long time user, first time poster.
I have this project that uses both Peter's cordova-plugin-ibeacon and the cordova-plugin-bluetoothle plugin. It was working great on Android 4.4 through 6 and all IOS versions. The idea is simple, using the iBeacon plugin, once the device enters a particular iBeacon's range, it will stop iBeacon monitoring and start scanning for a BTLE scanner using cordova-plugin-bluetoothle and connect and perform its operations.
I just started trying to get this project to work with an Android 7.0 (Nougat) on Nexus 5X.
What I observed is that there are two issues:
I suspect this has something to do with the Background Optimization with Android 7.0: https://developer.android.com/topic/performance/background-optimization.html But I do not know the native platform enough to actually confirm that.
Thanks much guys!