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
  • Slider UI
  • Editable UI
  • List UI
  • Editable List UI
  • Remote properties
  • Remote Editable UI
  1. Configuration subclasses
  2. Supported property types

Integer

PreviousBooleanNextFloat

Last updated 4 months ago

Int is platform dependent, 32-bit signed values on 32-bit CPUs (Apple Watch; arm64_32) and 64-bit signed values on 64-bit CPUs (iPhone, iPad; arm64).

The default value of a Int is 0. You can change the default value of the property by assigning a new value in an overridden method.

NSInteger is platform dependent, 32-bit signed values on 32-bit CPUs (Apple Watch arm64_32) and 64-bit signed values on 64-bit CPUs (iPhone, iPad arm64).

The default value of a NSInteger is 0. You can change the default value of the property by assigning a new value in an overridden method.

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

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

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

The default value of an Int is 0. You can change the default value of the property by assigning a new value in an overridden method.

The default value of an int is 0. 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.

React Native always converts the underlying Integer to a JavaScript Number - you should be aware of .

Local properties

Slider UI

Allows an integer property to be changed in Appfigurate using a slider between minimum and maximum values.

Swift prototype

@IntPropertySlider(min, max, icon, description, restart)
var propertyName: Int

You can customize the minimum and maximum images using the parameter. If restart is true, then the app will be restarted if the property value changes.

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {

    @IntPropertySlider(min: 50, max: 100, icon: .volume, description: "Limit volume level", restart: true)
    var volumeRange: Int
    
    override func reset() {
        volumeRange = 75
    }
    ...

Objective-C prototype

INT_PROPERTY_SLIDER(propertyName, minValue, maxValue, icon, description, restart)

You can customize the minimum and maximum images using the parameter. 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) NSInteger volumeRange;

@end

@implementation Configuration

INT_PROPERTY_SLIDER(volumeRange, 50, 100, APLIconSliderVolume, @"Limit volume level", NO);

- (void) reset {
    self.volumeRange = 75;
}
...

Kotlin prototype

@IntPropertySlider(description, minValue, maxValue, sliderIcon, restart)
var propertyName = 0

Kotlink example

import nz.co.electricbolt.appfiguratelibrary.Configuration
import nz.co.electricbolt.appfiguratelibrary.annotations.IntPropertySlider
import nz.co.electricbolt.appfiguratelibrary.annotations.IconSlider

class AppConfiguration : Configuration() {

    @IntPropertySlider(description = "Limit volume level", minValue = 50, maxValue = 100, sliderIcon = IconSlider.IconSliderVolume, restart = false)
    var volumeRange = 0
    
    override fun reset() {
        super.reset()
        volumeRange = 75
    }
    ...

Java prototype

@IntPropertySlider(description, minValue, maxValue, sliderIcon, restart)
int propertyName;

Java example

import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.IntPropertySlider;
import nz.co.electricbolt.appfiguratelibrary.annotations.IconSlider;

public class AppConfiguration extends Configuration {

    @IntPropertySlider(description = "Limit volume level", minValue = 50, maxValue = 100, sliderIcon = IconSlider.IconSliderVolume, restart = false)
    public int volumeRange;
    
    @Override
    public void reset() {
        super.reset();
        this.volumeRange = 75;
    }
    ...

Dart prototype

int get propertyName => nativeInt('propertyName');

Dart example

import 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    int get volumeRange => nativeInt('volumeRange');
    ...

JavaScript example

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

const {Appfigurate} = NativeModules;

...

let volumeRange = await Appfigurate.nativeValue("volumeRange"); // Number

Editable UI

Allows an integer property to be changed in Appfigurate using a text field between minimum and maximum values, and an optional regular expression validating input.

Swift prototype

@IntPropertyEdit(min, max, regex, description, restart)
var propertyName: Int

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

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {

    @IntPropertyEdit(min: 1, max: 5, regex: "", description: "Maximum number of game levels", restart: false)
    var gameLevels: Int
    
    override func reset() {
        gameLevels = 3
    }
    ...

Objective-C prototype

INT_PROPERTY_EDIT(propertyName, minValue, maxValue, regex, 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) NSInteger gameLevels;

@end

@implementation Configuration

INT_PROPERTY_EDIT(gameLevels, 1, 5, @"", @"Maximum number of game levels", NO);

- (void) reset {
    self.gameLevels = 3;
}
...

Kotlin prototype

@IntPropertyEdit(description, minValue, maxValue, regularExpression, restart)
var propertyName = 0

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.IntPropertyEdit

class AppConfiguration : Configuration() {

    @IntPropertyEdit(description = "Maximum number of game levels", minValue = 1, maxValue = 5, restart = false)
    var gameLevels = 0
    
    override fun reset() {
        super.reset()
        gameLevels = 3
    }
    ...

Java prototype

@IntPropertyEdit(description, minValue, maxValue, regularExpression, restart)
int 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.IntPropertyEdit;

public class AppConfiguration extends Configuration {

    @IntPropertyEdit(description = "Maximum number of game levels", minValue = 1, maxValue = 5, restart = false)
    public int gameLevels;
    
    @Override
    public void reset() {
        super.reset();
        this.gameLevels = 3;
    }
    ...

Dart prototype

int get propertyName => nativeInt('propertyName');

Dart example

Dimport 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    int get gameLevels => nativeInt('gameLevels');
    ...

JavaScript example

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

const {Appfigurate} = NativeModules;

...

let gameLevels = await Appfigurate.nativeValue("gameLevels"); // Number

List UI

Allows an integer property to be changed in Appfigurate by allowing the user to select from a predefined list of valid choices.

Swift prototype

@IntPropertyList(description, restart, values)
var propertyName: Int

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

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {

    @IntPropertyList(description: "Quality rating", restart: false, values: ["Low": 10, "Average": 50, "Excellent": 95])
    var rating: Int
    
    override func reset() {
        rating = 10
    }
    ...

Objective-C prototype

INT_PROPERTY_LIST(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) NSInteger rating;

@end

@implementation Configuration

INT_PROPERTY_LIST(rating, @"Quality rating", NO, @{@"Low": @10, @"Average": @50, @"Excellent": @95});

- (void) reset {
    self.rating = 10;
}
...

Kotlin prototype

@IntPropertyList(description, keys, values, restart)
var propertyName = 0

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.IntPropertyList

class AppConfiguration : Configuration() {

    @IntPropertyList(description = "Quality rating", keys = ["Low", "Average", "Excellent"], values = [10, 50, 95], restart = false)
    var rating = 0
    
    override fun reset() {
        super.reset()
        rating = 10
    }
    ...

Java prototype

@IntPropertyList(description, keys, values, restart)
int propertyName;

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

Java example

import nz.co.electricbolt.appfiguratelibrary.Configuration;java
import nz.co.electricbolt.appfiguratelibrary.annotations.IntPropertyList;

public class AppConfiguration extends Configuration {

    @IntPropertyList(description = "Quality rating", keys = {"Low", "Average", "Excellent"}, values = {10, 50, 95}, restart = false)
    public int rating;
    
    @Override
    public void reset() {
        super.reset();
        this.rating = 10;
    }
    ...

Dart prototype

int get propertyName => nativeInt('propertyName');

Dart example

import 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    int get rating => nativeInt('rating');
    ...

JavaScript example

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

const {Appfigurate} = NativeModules;

...

let rating = await Appfigurate.nativeValue("rating"); // Number

Editable List UI

Allows an integer property to be changed in Appfigurate by allowing the user to select from a predefined list of valid choices. The user can customize the list adding by additional values using a text field between minimum and maximum values, and an optional regular expression validating input.

Swift prototype

@IntPropertyListEdit(min, max, regex, description, restart, values)
var propertyName: Int

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

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {

    @IntPropertyListEdit(min: 0, max: 365, regex: "^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$", description: "Duration in days emails are available", restart: false, values: ["7 days": 7, "1 month": 30, "1 Year": 365])
    var availablityDuration: Int
    
    override func reset() {
        volumeRange = 7
    }
    ...Swift 

Objective-C prototype

INT_PROPERTY_LIST_EDIT(propertyName, minValue, maxValue, regex, 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) NSInteger availabilityDuration;

@end

@implementation Configuration

INT_PROPERTY_LIST_EDIT(availablityDuration, 0, 365, @"^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$", @"Duration in days emails are available", NO, @{@"7 days": @7, @"1 month": @30, @"1 Year": @365});

- (void) reset {
    self.volumeRange = 7;
}
...Objective-C 

Kotlin prototype

@IntPropertyListEdit(description, regularExpression, minValue, maxValue, keys, values, restart)
Int propertyName;

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.IntPropertyListEdit

class AppConfiguration : Configuration() {

    @IntPropertyListEdit(description = "Duration in days emails are available", minValue = 0, maxValue = 365, regularExpression = "^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$", keys = ["7 days", "1 month", "1 Year"], values = [7, 30, 365], restart = false)
    var availablityDuration = 0
    
    override fun reset() {
        super.reset()
        availabilityDuration = 7
    }
    ...

Java prototype

@IntPropertyListEdit(description, regularExpression, minValue, maxValue, keys, values, restart)
int 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.IntPropertyListEdit;

public class AppConfiguration extends Configuration {

    @IntPropertyListEdit(description = "Duration in days emails are available", minValue = 0, maxValue = 365, regularExpression = "^(0?[0-9]?[0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-5])$", keys = {"7 days", "1 month", "1 Year"}, values = {7, 30, 365}, restart = false)
    public int availablityDuration;
    
    @Override
    public void reset() {
        super.reset();
        this.availabilityDuration = 7;
    }
    ...

Dart prototype

int get propertyName => nativeInt('propertyName');

Dart example

import 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    int get availabilityDuration => nativeInt('availabilityDuration');
    ...

JavaScript example

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

const {Appfigurate} = NativeModules;

...

let availabilityDuration = await Appfigurate.nativeValue("availabilityDuration"); // Number

Remote properties

Remote Editable UI

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

Swift prototype

@RemoteIntPropertyEdit(remoteKey, description)
var propertyName: Int

Swift example

import AppfigurateLibrary

@objcMembers class Configuration: APLConfiguration {
    
    @RemoteIntPropertyEdit(remoteKey: "bookingDuration", description: "Duration (days) for reservation bookings")
    var bookingDuration: Int
    
    override func reset() {
        bookingDuration = 180
    }
    ...

Objective-C prototype

REMOTE_INT_PROPERTY_EDIT(propertyName, remoteKey, description)

Objective-C example

@import AppfigurateLibrary;

@interface Configuration : APLConfiguration

@property(nonatomic, assign) NSInteger bookingDuration;

@end

@implementation Configuration

REMOTE_INT_PROPERTY_EDIT(bookingDuration, @"bookingDuration", @"Duration (days) for reservation bookings");

- (void) reset {
    self.bookingDuration = 180;
}
...

Kotlin prototype

@RemoteIntPropertyEdit(remoteKey, description)
var propertyName = 0

Kotlin example

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

class AppConfiguration : Configuration() {

    @RemoteIntPropertyEdit(remoteKey = "bookingDuration", description = "Duration (days) for reservation bookings")
    var bookingDuration = 0
    
    override fun reset() {
        super.reset()
        bookingDuration = 180
    }
    ...

Java prototype

@RemoteIntPropertyEdit(remoteKey, description)
int propertyName;

Java example

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

public class AppConfiguration extends Configuration {

    @RemoteIntPropertyEdit(remoteKey = "bookingDuration", description = "Duration (days) for reservation bookings")
    public int bookingDuration;
    
    @Override
    public void reset() {
        super.reset();
        this.bookingDuration = 180;
    }
    ...

Dart prototype

int get propertyName => nativeInt('propertyName');

Dart example

Dimport 'package:appfigurateflutter/appfigurateflutter.dart';

public class Configuration extends APLNativeConfiguration {

    int get bookingDuration => nativeInt('bookingDuration');
    ...

JavaScript example

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

const {Appfigurate} = NativeModules;

...

let bookingDuration = await Appfigurate.nativeValue("bookingDuration"); // Number

You can customize the minimum and maximum images using the parameter. If restart is true, then the app will be restarted if the property value changes.

You can customize the minimum and maximum images using the parameter. If restart is true, then the app will be restarted if the property value changes.

Allows a third party remote configuration provider's integer property to be changed locally in Appfigurate using a text field. 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.

sliderIcon
sliderIcon
reset
reset
APLConfiguration
reset
reset
APLNativeConfiguration
APLConfiguration
nz.co.electricbolt.appfiguratelibrary.Configuration
APLConfiguration
nz.co.electricbolt.appfiguratelibrary.Configuration
JavaScript's 53 bit limitation
icon
icon