umair13adil / simple_beacons_flutter

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

Some issues || in Background and timing (after kill the app.) #11

Closed is10vmust closed 4 years ago

is10vmust commented 4 years ago

Hello , first of all i would to thank you about this useful plug in , i was run the plug in into both IOS and Android and it works good , but after i killed the app the ble stop scaning and i got like this :: MY LOGS ----->>

W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 I/chatty ( 8515): uid=10267(com.ensperity.projectcoronas) identical 1 line W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 D/BluetoothLeScanner( 8515): onScannerRegistered() - status=0 scannerId=9 mScannerId=0 E/ ( 8515): [ZeroHung]zrhung_get_config: Get config failed for wp[0x0008] W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 I/ScanHelper( 8515): Non-distinct packets detected in a single scan. Restarting scans unecessary. W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 W/FlutterJNI( 8515): Tried to send a platform message to Flutter, but FlutterJNI was detached from native C++. Could not send. Channel: beacons_plugin_stream. Response ID: 0 D/BeaconHelper( 8515): didExitRegion I/ScanJob ( 8515): Using immediateScanJobId from manifest: 208352939 I/ScanJob ( 8515): Using periodicScanJobId from manifest: 208352940 W/JobInfo ( 8515): Requested interval +5m0s0ms for job 208352940 is too small; raising to +15m0s0ms W/JobInfo ( 8515): Requested flex 0 for job 208352940 is too small; raising to +5m0s0ms I/ScanJob ( 8515): Using periodicScanJobId from manifest: 208352940 I/ScanJob ( 8515): onStopJob called for immediate scan org.altbeacon.beacon.service.ScanJob@1ba2fba I/CycledLeScanner( 8515): Using Android O scanner I/ScanJob ( 8515): Using immediateScanJobId from manifest: 208352939 I/ScanJob ( 8515): Running immediate scan job: instance is org.altbeacon.beacon.service.ScanJob@ff8b15d

-------------------------------------------------------------------------------------------->>> THE REASON OF MY APP >>> i only need to know if i was connect to the beacon device every 1 min i need to scan if it around or not in foreground and in background (after kill the app) , it this plug-in will help us or i miss understand the concept of it.

--------------------------------------------------------------------------------------------->> THE CONCLUSION ::(as questions) :

  1. how can i remove the stacked notification (Looking for nearby beacons)
  2. how i can make the plug-in scans every 1 min 3 . is the plug-in works in background (after kill). .............................................................................................................................||.......................................................>> again i would to thanks you and i hope to fix that issues asap...-> 💯
umair13adil commented 4 years ago

1. how can i remove the stacked notification (Looking for nearby beacons)

To stop monitoring beacons, you must call this from flutter:

await BeaconsPlugin.stopMonitoring;

Chances are when you force kill the app, this is not called, that’s why the service keeps running in the background.

2. how i can make the plug-in scans every 1 min

For now there is no option to scan every 1 min, you will need to read scan on your app after 1 min, plugin will provide results every 1 second.

3. is it the plug-in works in the background (after kill).

Yes, beacons background service is not killed even after the app is killed.

Please check the updated ReadMe file.