Define handlers for the expressions you wish to add:
Register with Player. Subsequent registrations of an expression with the same name will override previous values.
Any calls to myCustomFunction() within the flow will utilize the newly registered expression:
The ExpressionPlugin enables consumers to register custom expressions in native JVM code. Simply supply a map of expression name to handler on instantiation, and the expressions will be available within the content. Handlers receive arguments are as a List<Any?> and are permitted to return Any?.
Usage
In build.gradle
In Player constructor
In Player content
CocoaPods
Add the subspec to your Podfile
Swift Usage
The ExpressionPlugin lets you register custom expressions to run native code:
Arguments
Arguments can be passed to custom expressions, and your handler receives the arguments as an array of Any: