Plain String
Last updated
Last updated
The default value of a String
is nil. You must change the default value of the property by assigning a new value in an overridden reset
method.
The default value of a NSString
is nil. You must change the default value of the property by assigning a new value in an overridden reset
method.
NSString
properties should be declared in your APLConfiguration
subclass header file as follows:
@import AppfigurateLibrary;
@interface Configuration : APLConfiguration
@property(nonatomic, assign) double propertyName;
...
The default value of a String
is null. You must change the default value of the property by assigning a new value in an overridden reset
method.
The default value of a String
is null. You must change the default value of the property by assigning a new value in an overridden reset
method.
The flutter APLNativeConfiguration
class defers to the underlying platform APLConfiguration
(iOS) or nz.co.electricbolt.appfiguratelibrary.Configuration
(Android) subclass to read property values.
The React Native module AppfigurateModule
class defers to the underlying platform APLConfiguration
(iOS) or nz.co.electricbolt.appfiguratelibrary.Configuration
(Android) subclass to read property values.
This page describes plain textual strings. Appfigurate also supports encrypted strings.
Allows a string property to be changed in Appfigurate using a text field with an optional regular expression validating input.
Swift prototype
@StringPropertyEdit(regex, description, restart)
var propertyName:
Swift example
import AppfigurateLibrary
@objcMembers class Configuration: APLConfiguration {
@StringPropertyEdit(regex: "", description: "Overridden session username", restart: false)
var usernameOverride:
override func reset() {
usernameOverride = "thomas52"
}
...
Objective-C prototype
STRING_PROPERTY_EDIT(propertyName, regex, description, restart)
Objective-C example
@import AppfigurateLibrary;
@interface Configuration : APLConfiguration
@property(nonatomic, strong) NSString* usernameOverride;
@end
@implementation Configuration
STRING_PROPERTY_EDIT(usernameOverride, @"", @"Overridden session username", NO);
- (void) reset {
self.usernameOverride = @"thomas52";
}
...
Kotlin prototype
@StringPropertyEdit(description, regularExpression, restart)
var propertyName:
Kotlin example
import nz.co.electricbolt.appfiguratelibrary.Configuration
import nz.co.electricbolt.appfiguratelibrary.annotations.StringPropertyEdit
class AppConfiguration : Configuration() {
@StringPropertyEdit(description = "Overridden session username", regularExpression = "", restart = false)
var usernameOverride:
override fun reset() {
super.reset()
usernameOverride = "thomas52"
}
...
Java prototype
@StringPropertyEdit(description, regularExpression, restart)
String propertyName;
Java example
import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.StringPropertyEdit;
public class AppConfiguration extends Configuration {
@StringPropertyEdit(description = "Overridden session username", regularExpression = "", restart = false)
public String usernameOverride;
@Override
public void reset() {
super.reset();
this.usernameOverride = "thomas52";
}
...
Dart prototype
String get propertyName => nativeString('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
String get usernameOverride => nativeString('usernameOverride');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let usernameOverride = await Appfigurate.nativeValue("usernameOverride");
Allows a string property to be changed in Appfigurate by allowing the user to select from a predefined list of valid choices.
Swift prototype
@StringPropertyList(description, restart, values)
var propertyName:
Swift example
import AppfigurateLibrary
@objcMembers class Configuration: APLConfiguration {
@StringPropertyList(description: "Color of background", restart: false, values: ["LightGray":"#d3d3d3", "White":"#ffffff", "Beige":"f5fcdc"])
var backgroundColorHex:
override func reset() {
backgroundColorHex = "#d3d3de"
}
...
Objective-C prototype
STRING_PROPERTY_LIST(propertyName, description, restart, ...)
Objective-C example
@import AppfigurateLibrary;
@interface Configuration : APLConfiguration
@property(nonatomic, strong) NSString* backgroundColorHex;
@end
@implementation Configuration
STRING_PROPERTY_LIST(backgroundColorHex, @"Color of background", NO, @{@"LightGray": @"#d3d3d3", @"White": @"#ffffff", @"Beige": @"f5fcdc"});
- (void) reset {
self.backgroundColorHex = "#d3d3d3";
}
...
Kotlin prototype
@StringPropertyList(description, keys, values, restart)
var propertyName:
Kotlin example
import nz.co.electricbolt.appfiguratelibrary.Configuration
import nz.co.electricbolt.appfiguratelibrary.annotations.StringPropertyList
class AppConfiguration : Configuration() {
@StringPropertyList(description = "Color of background", keys = ["LightGray", "White", "Beige"], values = ["#d3d3d3", "#ffffff", "f5fcdc"], restart = false)
var backgroundColorHex:
override fun reset() {
super.reset()
backgroundColorHex = "#d3d3d3"
}
...
Java prototype
@StringPropertyList(description, keys, values, restart)
String propertyName;
Java example
import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.StringPropertyList;
public class AppConfiguration extends Configuration {
@StringPropertyList(description = "Color of background", keys = {"LightGray", "White", "Beige"}, values = {"#d3d3d3", "#ffffff", "f5fcdc"}, restart = false)
public String backgroundColorHex;
@Override
public void reset() {
super.reset();
this.backgroundColorHex = "#d3d3d3";
}
...
Dart prototype
String get propertyName => nativeString('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
String get backgroundColorHex => nativeString('backgroundColorHex');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let backgroundColorHex = await Appfigurate.nativeValue("backgroundColorHex");
Allows a string 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 and an optional regular expression validating input.
Swift prototype
@StringPropertyListEdit(regex, description, restart, values)
var propertyName:
Swift example
import AppfigurateLibrary
@objcMembers class Configuration: APLConfiguration {
@StringPropertyListEdit(regex: "^#([a-f0-9]{6})$", description: "Color of foreground", restart: false, values: ["Black":"#000000", "MistyRose":"#ffe4e1", "LightBlue":"add8e6"])
var foregroundColorHex:
override func reset() {
foregroundColorHex = "#ffe4e1"
}
...
Objective-C prototype
STRING_PROPERTY_LIST_EDIT(propertyName, regex, description, restart, ...)
Objective-C example
@import AppfigurateLibrary;
@interface Configuration : APLConfiguration
@property(nonatomic, strong) NSString* foregroundColorHex;
@end
@implementation Configuration
STRING_PROPERTY_LIST_EDIT(foregroundColorHex, @"^#([a-f0-9]{6})$", @"Color of foreground", NO, @{@"Black": @"#000000", @"MistyRose": @"#ffe4e1", @"LightBlue": @"add8e6"});
- (void) reset {
self.foregroundColorHex = @"#ffe4e1";
}
...
Kotlin prototype
@StringPropertyListEdit(description, regularExpression, keys, values, restart)
var propertyName:
Kotlin example
import nz.co.electricbolt.appfiguratelibrary.Configuration
import nz.co.electricbolt.appfiguratelibrary.annotations.StringPropertyListEdit
class AppConfiguration : Configuration() {
@StringPropertyListEdit(description = "Color of foreground", regularExpression = "^#([a-f0-9]{6})$", keys = ["Black", "MistyRose", "LightBlue"], values = ["#000000", "#ffe4e1", "add8e6"], restart = false)
var foregroundColorHex:
override fun reset() {
super.reset()
foregroundColorHex = "#ffe4e1"
}
...
Java prototype
@StringPropertyListEdit(description, regularExpression, keys, values, restart)
String propertyName;
Java example
import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.StringPropertyListEdit;
public class AppConfiguration extends Configuration {
@StringPropertyListEdit(description = "Color of foreground", regularExpression = "^#([a-f0-9]{6})$", keys = {"Black", "MistyRose", "LightBlue"}, values = {"#000000", "#ffe4e1", "add8e6"}, restart = false)
public String foregroundColorHex;
@Override
public void reset() {
super.reset();
this.foregroundColorHex = 100.0;
}
...
Dart prototype
String get propertyName => nativeString('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
String get foregroundColorHex => nativeString('foregroundColorHex');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let foregroundColorHex = await Appfigurate.nativeValue("foregroundColorHex");
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 string 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.
Swift prototype
@RemoteStringPropertyEdit(remoteKey, description, restart)
var propertyName: String
Swift example
import AppfigurateLibrary
@objcMembers class Configuration: APLConfiguration {
@RemoteStringPropertyEdit(remoteKey: "appTitle", description: "Title of application")
var appTitle: String
override func reset() {
appTitle = "Holiday finder"
}
...
Objective-C prototype
REMOTE_STRING_PROPERTY_EDIT(propertyName, remoteKey, description)
Objective-C example
@import AppfigurateLibrary;
@interface Configuration : APLConfiguration
@property(nonatomic, assign) String appTitle;
@end
@implementation Configuration
REMOTE_STRING_PROPERTY_EDIT(appTitle, @"Title of application");
- (void) reset {
self.appTitle = @"Holiday finder";
}
...
Kotlin prototype
@RemoteStringPropertyEdit(remoteKey, description)
var propertyName:
Kotlin example
import nz.co.electricbolt.appfiguratelibrary.Configuration
import nz.co.electricbolt.appfiguratelibrary.annotations.RemoteStringPropertyEdit
class AppConfiguration : Configuration() {
@RemoteStringPropertyEdit(remoteKey = "appTitle", description = "Title of application")
var appTitle:
override fun reset() {
super.reset()
appTitle = "Holiday finder"
}
...
Java prototype
@RemoteStringPropertyEdit(remoteKey, description)
String propertyName;
Java example
import nz.co.electricbolt.appfiguratelibrary.Configuration;
import nz.co.electricbolt.appfiguratelibrary.annotations.RemoteStringPropertyEdit;
public class AppConfiguration extends Configuration {
@RemoteStringPropertyEdit(remoteKey = "appTitle", description = "Title of application")
public String appTitle;
@Override
public void reset() {
super.reset();
this.appTitle = "Holiday finder";
}
...
Dart prototype
String get propertyName => nativeString('propertyName');
Dart example
import 'package:appfigurateflutter/appfigurateflutter.dart';
public class Configuration extends APLNativeConfiguration {
String get appTitle => nativeString('appTitle');
...
JavaScript example
import {
NativeModules,
} from 'react-native';
const {Appfigurate} = NativeModules;
...
let appTitle = await Appfigurate.nativeValue("appTitle");