is it possible to run Scan Beacon when app is Killed - dart

Hello I'm new developer so i need some help Now. I was Bullied app doing Brodcast and Scan Beacon i used flutter_beacon 0.3.0
and for Brodcast i use beacon_broadcast 0.2.1 its working good for Advertising and Scan event when app is Background,but when app is kill or i remove app from list Running applications the Scan and Brodcast not Working
Now My Question is How to running code scan and Brodcast when app is killed or Finished ???

Yes, it is absolutely possible to resume beacon scanning on both Android and iOS after an app is killed. But the specifics of how you do this are different between iOS and Android. Further, the use of non-native development frameworks like FlutterBeacon make things more complicated as the documentation is not as complete for this use case.
While I am not an expert on FlutterBeacon, I am the lead developer on the underlying Android Beacon Library which it uses under the hood. I am also very familiar with how iOS CoreLocation works (which it also uses under the hood.)
In general here are the rules to get apps to detect after being killed:
iOS:
Start beacon monitoring (not just ranging) in the didFinishLaunching method of the AppDelegate
Obtain ALWAYS Location permission
After the app is killed it will be re-launched in the background when all beacons disappear or the first beacon appears in a monitored region.
Android:
Start beacon monitoring in the onCreate method of an Android application class using RegionBootstrap. See here for a discussion on the FlutterBeacon github
Obtain BACKGROUND_LOCATION permission from the user.
On Android 8+, your app should restart within 25 minutes of being killed and give you a callback to the BootstrapNotifier methods as appropriate.

Related

How Do i relaunch my iOS app from Kill state for long task?

First i will explain what i want to achieve.
I have a BLE lock. i want that my application will wake up from kill state and start scanning BLE device. Once the BLE device found it will connect with my phone and get unlock.
All this is working in background mode and i tested this many times. but i also want this to be work when app is in kill state.
I tried several things. First I tried Geofencing but in case of geofencing app wake up for less time i'm not properly scan the BLE device. When didEnterRegion region: called i sent the local notification and it was working fine. So after that i tried to scan BLE Devices when didEnterRegion region: and also get the notification that scan is started but i think after some time app remove from the background automatically and could not relaunch. So that's why i'm failed to discovered any BLE device.
I also read apple document for Core BlueTooth:
https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/CoreBluetooth_concepts/CoreBluetoothBackgroundProcessingForIOSApps/PerformingTasksWhileYourAppIsInTheBackground.html
There is mention that how to perform long task like open and close door lock but isn't help me.
Please guide me how to do this when app is in kill state.
Thanks for the help :)
UPDATE:
What i mean from kill state is suspended/ terminated/removed from background. I just want that once user get enter into the region of geofence then app launch in background and scanning for the BLE device started. so after that i want app will stay into the background until door get unlock.
As Paulw11 mentioned, there's no way to relaunch an app in the background once it is terminated/killed by the user. Apple have done this deliberately for security and functionality reasons: if a user deliberately kills an app because it is buggy/faulty, the app should not be able to relaunch itself.
More information can be found here:-
Core Bluetooth Background Processing for iOS Apps
BLE device keep connect with iPhone when application terminate
I hope this helps.
did u try SLC. It wakes up the app after a kill. Then u can run a long running background task for BLE activity.

iOS background service using BLE after reboot

I'm new to mobile development, before eventually deciding where to develop (android/ iOS) a specific application I have a question (I'd prefer using an iPhone):
So the background is that I have a BLE device frequently sending data to the phone and let the phone app sync the data to the cloud. Now, it is really important that if for some reason the phone has to restart, it will automatically proceed receiving the BLE data.
Is it possible at all in iOS to start a background process (handling BLE packets) after reboot automatically. Thus e.g. when the respective BLE device pairs to the phone after a reboot, that the background process starts automatically, without the user having to start the app manually?
Doing some research I came up with mixed results regarding this scenario and would be grateful if someone with iOS experience could clarify.
(BTW: It does not have to be an Apple App Store Application)
A Few days ago I was working on BLE devices Beacons we supposed to make mobile application and start monitoring these beacons and send date monitoring to API.
This works fine in background, even the user was not running the application in foreground or reboot his iPhone.
All we should do is put the monitoring code at the appDelegate of the application to work in the background.

watch OS 2 beacon monitoring and ranging

has anybody found any information about interacting (ranging and monitoring) with Beacons in native Watch OS 2 applications?
I would like to give the user the possibility to range one in an home environment without having the phone in their pocket.
I can't find any docs anywhere and I am wondering if it's actually feasible - and obviously if there is any kind of example around.
Thanks
Core Location on watchOS is stripped of all the iBeacon functionality. There are no startRangingBeaconsInRegion: and startMonitoringForRegion: methods, as can be seen in the CLLocationManager reference documentation:
https://developer.apple.com/library/watchos/documentation/CoreLocation/Reference/CLLocationManager_Class/
The only option for now is to do the ranging/monitoring on the iPhone, and pass the results to the Watch app via the Watch Connectivity Framework.
UPDATE for watchOS 4: still no iBeacon in Core Location, but there's now Core Bluetooth available for the watchOS apps, which means your app can detect non-iBeacon packets, such as Eddystone, or Estimote's Nearable/Telemetry.
Only if your app is in the foreground or has execution time though. The latter meaning that, for example, if your app is already running in the background because you're using the new "location updates" background mode for turn-by-turn navigation, or you're tracking workouts in the background, then you can at the same time scan for beacons. In and on itself, detecting Bluetooth beacons won't keep your app alive in the background, it will get suspended.
directly use watch to monitor/ranging with watchOS is prohibited by Apple (it detailed in developer document). It mean you can not turn bluetooth on watch and start monitoring directly! But there're another way, you can integrate app with watchOS, I gave a tried before with our app and it work pretty good. We're using Estimote, you can refer right here: Estimote Watch SDK Integration
It can be transport notification from iOS device to watch. They provide several helpers support that. Good luck!

ibeacon on ios 7.1 - app stop listening to beacon after a while

I m building some app with iBeacon capability. The app will given notification when enter beacon region.
However, the app somehow stops listening to beacon after a few hours to half day. I does not start listening either after I kill the app and start it again. It only works after I restart the phone.
Ps: I m running ios 7.1.1 on a 4s.
Also, it has been mention by a few online post that app can listen to beacon region even if the app is not running at the background. That's has never worked for me.
I need a few pointers from someone who has successfully made this happen. Thanks!
You are experiencing a known iOS 7.1 bug that makes CoreLocation stop looking for iBeacons after awhile. See here: iBeacon: didRangeBeacons stops getting called, must reset device for it to work again
There is no known solution. You simply have to reboot your phone as a workaround until Apple releases iOS 7.2 with (hopefully) a fix.
To test background monitoring with the app not running, simply do a first detection with your app, reboot your phone, and wait up to 15 min while your iBeacon is transmitting.

Geo Notification on app that is off

Geo Fencing is praised by many, yet I could not easily find an answer to the following.
iOS and/or Android, does an inactive app send you notifications if you are close by?
My question is probably more like: is there an underlying system that knows your app needs to check for your location against the in-app locations and does so despite the app not being active.
Forget the settings where you can switch off geolocation for particular apps, let's assume that is switched on.
But let's assume I just switched my iphone on, no app is running yet. So I am carrying that sleeping phone in my pocket. Would I receive location notifications?
I am currently testing this with Highlight, but maybe someone knows the code/tech side to this answer.
Varies by OS.
On Android, apps can run as a service that are automatically started when the phone boots up. In this case, the user does not need to start the app. So, on Android, yes you would receive location notifications in sleep mode. See http://developer.android.com/guide/components/services.html or https://stackoverflow.com/questions/9866970/tutorial-for-android-services for more info on Android Services.
On Apple, I'm not so sure about running apps as a service like Android. However, I believe there are events that apps in the background can register for. So again, the app (once started) would receive notifications in sleep mode.

Resources