# React Native API

## function nativeValue(propertyName)

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

Introspect the native app's [<mark style="color:blue;">`APLConfiguration`</mark>](https://www.electricbolt.co.nz/api/Classes/APLConfiguration.html) subclass for the `propertyName` specified. The possible types returned are: [Boolean](/configuration-subclasses/supported-property-types/boolean.md), [String](/configuration-subclasses/supported-property-types/plain-string.md) or [Number](/configuration-subclasses/supported-property-types/double.md). See [supported property types](/configuration-subclasses/supported-property-types.md) for exact conversion semantics.

## function setLogging(value)

```javascript
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 with logging set to false. See also [APLLogging](/additional-reading/info.plist-options.md#apllogging) key in the [Info.plist](/additional-reading/info.plist-options.md) file.

## function version()

```javascript
await Appfigurate.version();
```

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

## function description()

```javascript
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) properties which omit the property name.

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

## function modifications()

```javascript
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) properties which omit the property name.

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

## function saveConfiguration()

```javascript
await Appfigurate.saveConfiguration();
```

Saves the configuration persisted in the Keychain into temporary storage.

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

## function restoreConfiguration()

```javascript
await Appfigurate.restoreConfiguration();
```

Restores the configuration from temporary storage back into the Keychain.

## function addListener(...)

Registers a callback that will be invoked every time Appfigurate has updated the configuration of the app. The `result` parameter is a `Map` with a single entry. The entries key is `'APLConfigurationUpdatedAction'` . The entries value is either `null` or a `String`. If `null`, then configuration was applied. If a `String`, then the an action was executed, and the value will be the name of the action.

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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.electricbolt.co.nz/api/react-native-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
