Call External Method
The Call External Method action enables communication from Digia UI pages to native Flutter code. This action sends messages through the MessageBus to trigger native functionality or platform-specific operations. The payload supports any valid JSON data structure.
Properties
name
string
Yes
The message name/channel to send to native code.
payload
object
No
Optional JSON object to send as parameters to the native handler. Individual property values can contain dynamic expressions, but the payload itself must be an object structure.
Examples
All payload data is automatically converted to JSON format before being sent to native code. The payload must be a JSON object where individual property values can contain dynamic expressions. Direct dynamic expressions for the entire payload are not supported.
Basic Message Sending

Sends a message named "login" with user data to native code.
Note: You cannot use dynamic expressions for both
nameandpayloadsimultaneously. The payload must be a JSON object where individual property values can contain dynamic expressions, not a direct dynamic expression.
Use Cases
Native API Integration: Call device APIs not available in the UI framework
Platform-Specific Features: Trigger camera, sensors, or hardware functionality
Analytics Tracking: Send custom events to native analytics handlers
Third-Party Integration: Communicate with Flutter packages from Digia Studio
Custom Processing: Pass data to native code for specialized operations
Default Behavior
By default:
Message Delivery
Sends message immediately through MessageBus
Asynchronous
Action completes without waiting for native response
No Feedback
No built-in UI feedback or confirmation
Handler Required
Native code must implement DigiaMessageHandlerMixin
How to Use

Attach the action to a widget event (button tap, form submission, etc.)
Select Call External Method from the action list
Specify the
namethat native code will listen forOptionally provide
payloaddata to send to the native handler
//TODO : Add gif
Implementation Details
The action uses Flutter's MessageBus to send messages to native code. The payload is automatically JSON-serialized before transmission. Native widgets must implement DigiaMessageHandlerMixin to receive and handle these messages.
Limitations:
You cannot use dynamic expressions for both
nameandpayloadsimultaneouslyThe payload must be a JSON object where individual property values can contain dynamic expressions
Direct dynamic expressions like
"{{formData}}"are not supported for payload
Example native implementation:
Messages are sent asynchronously and the action completes immediately after sending, without waiting for native code response.
Related Actions
Execute Callback - Call predefined callback functions
Fire Event - Trigger analytics events
Set State - Update application state
Asset Placeholder: Tutorial video demonstrating native method calls and MessageBus integration in Digia Studio
Last updated