Functions

Catalyst Serverless Functions enable you to build custom functionalities in your application, automate tasks, or integrate with third-party services. You can develop functions for your mobile app from the Catalyst console or the CLI.

Note: You can create six types of functions in Catalyst: Basic I/O, Advanced I/O, Cron, Event, Integration, and Browser Logic functions. However, you can only execute Basic I/O functions in Catalyst Flutter SDK.

Create a Function Instance

You can create an instance of a Catalyst function using the getFunctionInstance() method, method, and enable the methods defined in this class to access the instance object. This will prevent unnecessary server calls.

The function instance can be fetched in two different ways.

By passing the Function ID

You can create a function instance by passing the ID of the function as an argument to the getFunctionInstance() method in the String format as shown in the syntax below:

    
copy
ZCatalystApp.getInstance().getFunctionInstance( String functionID )

Parameters:

  • functionID: The unique ID of the function configured in Catalyst

A sample code snippet is shown below:

    
copy
ZCatalystFunction function = ZCatalystApp.getInstance().getFunctionInstance(identifier: "158798998356682");

By passing the API name of the function

You can create a function instance by passing the API name of the function as an argument to the getFunctionInstance() method in the String format as shown in the syntax below:

    
copy
ZCatalystApp.getInstance().getFunctionInstance( String apiName )

Parameters:

  • apiName: The name of the function configured in Catalyst

A sample code snippet is shown below:

    
copy
ZCatalystFunction function = ZCatalystApp.getInstance().getFunctionInstance(identifier: "LocalBackUp");

Last Updated 2023-09-03 01:06:41 +0530 +0530