These docs are for v1.2. Click to read the latest docs for v1.3.

Miscellaneous

Battery Drain

It should be defined to the client that by leaving the ACTV8me iOS SDK listening module in the background it will result in a 2-4% battery drain per hour depending on the age of the iOS device.

First On Microphone Usage

iOS manages the audio session singleton assigned to each application. When an app is listening in the background, it is iOS that decides when the app stops listening. When listening in the background, a time limit is set for the microphone usage. The time limit iOS needs for the audio session determines how long the microphone will stay on.

Red Audio Bar

When an application is using the microphone and is in the background, the iOS operating system places a red header across the top of the screen to remind the user that the microphone is on. For iPhone X style devices, the red bar is replaced with a red pill in the top left of the device. This is a security feature of the operating system and cannot be suppressed or turned off.

iOS Permissions

iOS requires an app developer to declare permissions for any technology used to retrieve outside signals to a mobile device. Part of the function of the ACTV8me iOS SDK is to retrieve signals from the outside world and use them as triggers for offers, promotions, etc.

Permissions are set in the app’s info.plist file. The trigger to permission pairs are as follows:

Microphone Use:

  • To use the microphone to detect audio triggers, the key “NSMicrophoneUsageDescription” must be set with a string value describing why it’s needed.

Geo-Location:

  • Geographic locations are used in two aspects of the ACTV8me iOS SDK.
  • First, the ACTV8me iOS SDK would like to know the user’s location when they catch a trigger. To use this access, the key “NSLocationWhenInUseUsageDescription” must be set with a string value describing why it’s needed.
  • However, if BluetoothLE devices are desired to be detected (iBeacons, Gimbals...), then instead, the key “NSLocationAlwaysUsageDescription” must be set with a string value describing why it’s needed. BluetoothLE devices are handled through the location manager on the iOS device.

Also, if you are using Bluetooth Low Energy devices...

  • To detect Bluetooth Low Energy devices, the key “NSBluetoothPeripheralUsageDescription” must be set with a string value describing why it’s needed.

Look at the below image and set the permissions in app’s plist file

784

Code for Background Mode

In order to use the ACTV8me iOS SDK to listen in the background, the start, stop,
and time function is all handled by the client. We suggest using the function below

if (self.audio.autoMode) {
 [self.audio start];
 [NSObject cancelPreviousPerformRequestsWithTarget:self];
 [self performSelector:@selector(shutOffMicrophone) withObject:nil
afterDelay:60 * 60];
 } else {
 [self.audio stop];
 }
}