On-site wakeup

On-site wakeup

iOS provides a way to register an app with BLE beacons in such a way that even if the app is not running, a callback will be triggered when a user enters or exits the vicinity of a beacon.. Bluetooth must be active for the wake-up to work.

To activate it, you need to call :

    [NAOServicesConfig enableOnSiteWakeUp];

All regions associated with your app are tracked at all times, including when the app isn’t running. If a region boundary is crossed while an app isn’t running, that app is relaunched into the background to handle the event. Similarly, if the app is suspended when the event occurs, it’s woken up and given a short amount of time (around 10 seconds) to handle the event. So app will have to start nao service if need to stay working in background.

If nao service is not started at the launch of the application, you have to implement the method bellow to start nao service.

Add some code in the AppDelegate didFinishLaunchingWithOptions method:

    if ([launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey]) {
        // code that gets called on a wake-up here.
        // and start nao service if need 
    }

To turn-off the wake-up, call:

    [NAOServicesConfig disableOnSiteWakeUp];

 

Important:

On-site wake-up behavior is turned on by default: if your app is killed before all services are stopped, didFinishLaunchingWithOptions will be called even if you didn’t call [NAOServicesConfig enableOnSiteWakeUp];

So, if your application does not support the on site wake-up, you will have to add the code below. This allow to not execute code when the app is woken up on site

if ([launchOptions objectForKey:UIApplicationLaunchOptionsLocationKey]) {
// Do nothing if the application does not support wake-up (call return)
}

 

Determining the wakeup Availability

Here are some reasons why wakeup not be available:

  • The device doesn’t have the necessary hardware to support this feature.
  • The user denied the app the authorization to use ibeacon.
  • The user disabled location services in the Settings app.
  • The user disabled Background App Refresh in the Settings app, either for the device or for your app.
  • The device is in Airplane mode and can’t power up the necessary hardware.
    • Related Articles

    • On-site wakeup

      On Android, the wake-up mechanism is slightly different from iOS as there is no similarly efficient way to register to iBeacon identifiers. Instead, we rely on Android OS Location (information provided by the Android API from a combination of GPS/GSM ...
    • Moving site

      If your site is moving, the NAO Suite will need some additional information to offer the same capabilities as for static sites, especially to be able to use the phone motion sensors. Prerequisites NAO SDK fully integrated following the existing ...
    • ExitSite Management

      NAOSDK – ExitSite This callback is triggered when the NAO SDK determines that the user is no longer near the site beacons. By default, this interface is notified 5 minutes after the last BLE measurements are received by the NAO SDK. In version 23.03 ...
    • 1. Overview

      Setup workflow A typical Indoor Location setup has 6 steps: Site creation Map import Navigation walkways creation Beacon deployment Calibration and Positioning Database (PDB) generation PDB publication (making it avalable for mobile SDK consumption) ...
    • 10. Teams

      Team management can be done using REST API. API reference: Swagger UI Authentication requires the token of a corporate admin: Create team Use the following request template to create teams curl -X POST --header 'Content-Type: application/json' ...