Custom executable actions
Action UI
Allows the custom executable action to be executed by Appfigurate. Any configuration properties you modify in the action method are persisted. Actions appear below properties in the Appfigurate UI.

Swift prototype
As you cannot annotate a Swift method with a property wrapper, your action methods must be specified manually.
Replace XXX with the name of your action (e.g. freshInstall)
func XXXDescription() -> String
func XXXAction()
func XXXRestart() -> BoolIf you return true from your XXXRestart() method, then the app will be restarted after the action method is executed.
Swift example
@objcMembers class Configuration: APLConfiguration {
func freshInstallDescription() -> String {
return "Resets application to fresh install state"
}
func freshInstallAction() {
let defs = UserDefaults.standard
let dict = defs.dictionaryRepresentation()
for key in dict.keys {
defs.removeObject(forKey: key)
}
defs.synchronize()
}
func freshInstallRestart() -> Bool {
return false
}
...Objective-C prototype
If restart is YES then the app will be restarted after the action method is executed.
Objective-C example
Kotlin prototype
If restart is true then the app will be restarted after the action method is executed.
Kotlin example
Java prototype
If restart is true then the app will be restarted after the action method is executed.
Java example
When an action is executed in the underlying native APLConfiguration (iOS) or nz.co.electricbolt.appfiguratelibrary.Configuration (Android) subclass, Flutter is also notified. Override the actionExecuted(action) method in APLNativeConfiguration as follows to receive the action:
Dart example
When an action is executed in the underlying native APLConfiguration (iOS) or nz.co.electricbolt.appfiguratelibrary.Configuration (Android) subclass, React Native is also notified. Subscribe to an event emitter to receive the action:
JavaScript example
Last updated