Proximity SDK (iOS & Android) enables your app trigger enter and exit events when around a place of interest marked with a beacon.
Lets say you placed a beacon at the reception. Integrate Proximity SDK into your app - it will now know when you enter or exit the reception area you have defined (read more about software-defined range here). It works:
- in the foreground - when your app is up and running;
- in the background - when you’re scrolling through a different app or when you have your phone in your pocket;
- or when the app is killed.
Below, we cover the “killed” app case: how it works on different platforms, what are the specifics of testing, and what are the best practices for when you roll out the app to users. Make sure to read about running the app in the background here.
How to wake up the app when it's is killed and trigger events?
There are certain restrictions imposed by iOS and Android operating systems one needs to know when designing an app to work in the background, wake up from so-called “killed” state. They are introduced to improve user experience and optimize battery life.
An app ends up in a killed state in several cases:
- a user explicitly kills it
- the system kills an unused app to free up device memory
- the operating system kills an app to prolong battery life
The last two are especially common for Huawei and Xiaomi phones, as their OSes are designed to prevent unwanted app to reopen automatically.
Estimote Proximity SDK enables you to wake up from the killed state as long as you follow ground rules imposed by operating systems. The specifics may vary for different platforms but the ground rule is similar: the app can be restarted with Proximity SDK when a user enters the range of a beacon (again.)
On iOS, there are *two conditions* to wake up the app and trigger an event.
When testing, make sure that:
- A user goes out of the range of the beacon or any other beacons in the venue, so there’s a so-called “full” exit event. The user needs to get to the point when they are not receiving BLE signals from any of the beacons at the premises. This is not related to the software-defined zones but the actual, maximum range of beacons. For example, in the case of a single Proximity Beacon, it is approx. 70 meters.
- A user stays out of the range of any beacons for several minutes. Try 5 to 10 minutes.
After the user enters the range again, an app gets restored.
On Android, use Proximity Trigger.