React Native API

Tested version 0.75

function nativeValue(propertyName)

let value = await Appfigurate.nativeValue('propertyName');

Introspect the native app's APLConfiguration (iOS) / nz.co.electricbolt.appfiguratelibrary.Configuration (Android) subclass for the propertyName specified. The possible types returned are: Boolean, String or Number. See supported property types for exact conversion semantics.

function setLogging(value)

await Appfigurate.setLogging(true);

When true, Appfigurate library debugging messages will be output to the console. The default is false.

It is best practice to distribute applications via TestFlight / App Store / Google Play with logging set to false. See also APLLogging key in the (iOS, watchOS) Info.plist file or (Android) meta-data in AndroidManifest.xml file.

function version()

await Appfigurate.version();

Returns the version of the Appfigurate library in the format major.minor.patch. e.g. 5.1.2

function description()

await Appfigurate.description();

Returns the textual representation of all properties.

Property names are shortened to camel case and appended with the value, except for NSString (Obj-C) / String (Swift, Java, Kotlin) properties which omit the property name.

e.g. debugLog=5 would be returned as DL=5.

function modifications()

await Appfigurate.modifications();

Returns the textual representation of all properties that have non default (overridden) values.

Property names are shortened to camel case and appended with the non default value, except for NSString (Obj-C) / String (Swift, Java, Kotlin) properties which omit the property name.

e.g. userInteractionTimeout=60.0 would be returned as UIT=60.0.

function saveConfiguration()

await Appfigurate.saveConfiguration();

Saves the configuration persisted in the Keychain (iOS) / SharedPreferences (Android) into temporary storage.

Some apps have functionality to erase the Keychain / SharedPreferences to reset apps back to factory defaults, which has the side effect of removing any Appfigurate configuration persisted in the Keychain / shared preferences.

function restoreConfiguration()

await Appfigurate.restoreConfiguration();

Restores the configuration from temporary storage back into the Keychain (iOS) / SharedPreferences (Android).

function addListener(...)

Registers a callback that will be invoked every time Appfigurate has updated the configuration of the app. The result object contains a APLConfigurationUpdatedAction that has a value of either null or a String. If a String, then the an action was executed, and the value will be the name of the action.

AppfigurateEvents.addListener('APLConfigurationUpdated', result => {
    // do something
});

Last updated