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.
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:
copyZCatalystApp.getInstance().getFunctionInstance( String functionID )
Parameters:
- functionID: The unique ID of the function configured in Catalyst
A sample code snippet is shown below:
copyZCatalystFunction 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:
copyZCatalystApp.getInstance().getFunctionInstance( String apiName )
Parameters:
- apiName: The name of the function configured in Catalyst
A sample code snippet is shown below:
copyZCatalystFunction function = ZCatalystApp.getInstance().getFunctionInstance(identifier: "LocalBackUp");
Last Updated 2023-09-03 01:06:41 +0530 +0530
Yes
No
Send your feedback to us