Appfigurate™️
HomeDocumentation
  • Introducing Appfigurate™️ 3
  • Getting Started
    • Getting Started
    • Examples
    • Upgrade guide
      • v1.4.0 to v2.2.0
      • v2.1.1 to v2.2.0
      • v2.2.1 to v3.0.0
      • v3.2.1 to v4.0.0
    • iOS native app integration
      • iOS app extension integration
    • watchOS app integration
      • watchOS app extension integration
    • Android native app integration
    • Mobile Flutter integration
      • Flutter iOS
      • Flutter Android
    • React Native integration
      • iOS native module integration
      • Android native module integration
      • JavaScript integration
    • Third party remote configuration providers
      • Firebase Remote Config
      • Launch Darkly
      • Other third party remote configuration providers
  • Configuration subclasses
    • Supported property types
      • Boolean
      • Integer
      • Float
      • Double
      • Plain String
      • Encrypted String
    • Custom executable actions
    • Slider icon types
  • Additional reading
    • Info.plist options
    • AndroidManifest.xml options
    • Displaying overridden configuration
    • Security
      • Best practice
      • Encryption
      • Export compliance
      • App Store compliance
      • PrivacyInfo.xcprivacy
      • Rotating your private key
  • Automation testing
    • iOS native app automation testing
    • Android native automation testing
  • API
    • iOS and watchOS API
    • Android API
    • Mobile Flutter API
    • React Native API
  • Appfigurate User Guide
    • Introduction
    • Main menu
    • Select app
    • Add app
    • Import app
    • Install example apps
    • Settings
      • Passcode Lock
      • Restore
      • Backup
      • Delete all apps and Settings
      • Analytics
    • Edit app
    • Configure app
    • Permissions
  • Appfigurate SE user guide
    • Introduction
    • Manual encryption
      • ENCRYPTED_STRING macro/function
      • ENCRYPTED_STRING_IOS_WATCHOS macro/function
    • Setup iOS Simulator app
    • Setup Android Emulator app
    • Xcode source editor extension
      • Troubleshooting
    • Real device cloud testing services
      • BrowserStack
  • LEGAL
    • License Agreement
    • Privacy Policy
    • Release History
    • Third party notices
Powered by GitBook
On this page
  • Local properties
  • Switch UI
  • Remote properties
  • Remote Switch UI
  1. Configuration subclasses
  2. Supported property types

Boolean

PreviousSupported property typesNextInteger

Last updated 4 months ago

Bool properties must be either true or false. The default value of a Bool property is false. You can change the default value of the property by assigning a new value in an overridden method.

BOOL properties must be either YES or NO. The default value of a BOOL property is NO. You can change the default value of the property by assigning a new value in an overridden method.

BOOL properties should be declared in your subclass header file as follows:

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

@property(nonatomic, assign) BOOL propertyName;
...

Boolean properties must be either true or false. The default value of a Boolean property is false. You can change the default value of the property by assigning a new value in an overridden method.

boolean properties must be either true or false. The default value of a boolean property is false. You can change the default value of the property by assigning a new value in an overridden method.

The flutter class defers to the underlying platform (iOS) or (Android) subclass to read property values.

The React Native module AppfigurateModule class defers to the underlying platform (iOS) or (Android) subclass to read property values.

Local properties

Switch UI

Allows a boolean property to be changed in Appfigurate using a switch.

Swift prototype

@BoolProperty(description, restart)
var propertyName: Bool

If restart is true, then the app will be restarted if the property value changes.

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {
    
    @BoolProperty(description: "Enable debug logging to console", restart: false)
    var logging: Bool
    
    override func reset() {
        logging = true
    }
    ...

Objective-C prototype

BOOL_PROPERTY(propertyName, description, restart)

If restart is YES, then the app will be restarted if the property value changes.

Objective-C example

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

@property(nonatomic, assign) BOOL logging;

@end

@implementation Configuration

BOOL_PROPERTY(logging, @"Enable debug logging to console", NO);

- (void) reset {
    self.logging = YES;
}
...

Kotlin prototype

@BooleanProperty(description, restart)
var propertyName = false

If restart is true, then the app will be restarted if the property value changes.

Kotlin example

import nz.co.electricbolt.appfiguratelibrary.Configuration
import nz.co.electricbolt.appfiguratelibrary.annotations.BooleanProperty

public class AppConfiguration : Configuration() {

    @BooleanProperty(description = "Enable debug logging to console", restart = false)
    var logging = false
    
    override fun reset() {
        super.reset()
        logging = true
    }
    ...

Java prototype

@BooleanProperty(description, restart)
public boolean propertyName;

If restart is true, then the app will be restarted if the property value changes.

Java example

import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.BooleanProperty;

public class AppConfiguration extends Configuration {

    @BooleanProperty(description = "Enable debug logging to console", restart = false)
    public boolean logging;
    
    @Override
    public void reset() {
        super.reset();
        this.logging = true;
    }
    ...

Dart example

import 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    bool get logging => nativeBool('logging');
    ...

JavaScript example

import {
  NativeModules,
} from 'react-native';

const {Appfigurate} = NativeModules;

...

let logging = await Appfigurate.nativeValue("logging"); // true or false

Remote properties

Remote Switch UI

Third party remote configuration provider integration is currently in private beta and will be available in the next major release of Appfigurate.

Allows a third party remote configuration provider's boolean property to be changed locally in Appfigurate using a switch. If the override tick box is ticked off, the third party remote configuration provider's value is displayed. If the override tick box is ticked on, then you can use Appfigurate to locally override the value.

Swift prototype

@RemoteBoolProperty(remoteKey, description)
var propertyName: Bool

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {
    
    @RemoteBoolProperty(remoteKey: "alwaysDarkMode", description: "Force dark mode to be always set")
    var alwaysDarkMode: Bool
    
    override func reset() {
        alwaysDarkMode = false
    }
    ...

Objective-C prototype

BOOL_PROPERTY(propertyName, remoteKey, description)

Objective-C example

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

@property(nonatomic, assign) BOOL alwaysDarkMode;

@end

@implementation Configuration

BOOL_PROPERTY(alwaysDarkMode, @"alwaysDarkMode", @"Force dark mode to be always set");

- (void) reset {
    self.alwaysDarkMode = NO;
}
...

Kotlin prototype

@RemoteBooleanProperty(remoteKey, description)
var propertyName = false

Kotlin example

import nz.co.electricbolt.appfiguratelibrary.Configuration
import nz.co.electricbolt.appfiguratelibrary.annotations.RemoteBooleanProperty

public class AppConfiguration : Configuration() {

    @RemoteBooleanProperty(remoteKey = "alwaysDarkMode", description = "Force dark mode to be always set")
    var alwaysDarkMode = false
    
    override fun reset() {
        super.reset()
        alwaysDarkMode = true
    }
    ...

Java prototype

@RemoteBooleanProperty(remoteKey, description)
public boolean propertyName;

Java example

import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.RemoteBooleanProperty;

public class AppConfiguration extends Configuration {

    @RemoteBooleanProperty(remoteKey = "alwaysDarkMode", description = "Force dark mode to be always set")
    public boolean alwaysDarkMode;
    
    @Override
    public void reset() {
        super.reset();
        this.alwaysDarkMode = true;
    }
    ...

Dart example

import 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    bool get alwaysDarkMode => nativeBool('alwaysDarkMode');
    ...

JavaScript example

import {
  NativeModules,
} from 'react-native';

const {Appfigurate} = NativeModules;

...

let alwaysDarkMode = await Appfigurate.nativeValue("alwaysDarkMode"); // true or false

reset
reset
APLConfiguration
reset
reset
APLNativeConfiguration
APLConfiguration
nz.co.electricbolt.appfiguratelibrary.Configuration
APLConfiguration
nz.co.electricbolt.appfiguratelibrary.Configuration