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 Android 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, and enable the methods defined in this class to access the instance object. This will prevent unnecessary server calls.
You can create a function instance in any of the following ways:
Create a Function Instance by passing the Function ID
You can pass the function’s unique Function ID as an argument to the getFunctionInstance() method and create an instance for it:
copyZCatalystApp.getInstance().getFunctionInstance( id: Long ): ZCatalystFunction
Parameters:
- id: The unique Function ID of the function
A sample code snippet is shown below:
copyZCatalystApp.getInstance().getFunctionInstance(2823000000011091) //Replace this with your Function ID
Create a Function Instance by passing the API name of the function
You can pass the function’s API name as an argument to the getFunctionInstance() method and create an instance for it:
copyZCatalystApp.getInstance().getFunctionInstance( apiName: String ): ZCatalystFunction
Parameters:
- apiName: The name of the function configured in Catalyst
A sample code snippet is shown below:
copyZCatalystApp.getInstance().getFunctionInstance("LocalBackup") //Replace this with your function name
Last Updated 2023-09-03 01:06:41 +0530 +0530
Yes
No
Send your feedback to us