Functionインスタンスの作成
Catalyst Functionsを使用すると、アプリケーションにカスタム機能を構築したり、タスクを自動化したり、サードパーティサービスと統合したりできます。CatalystコンソールまたはCLIからiOSアプリ用のFunctionを開発できます。
Functionインスタンスの作成
getFunctionInstance()メソッドを使用して、Catalyst Functionのインスタンスを作成し、このクラスで定義されたメソッドを有効にしてインスタンスオブジェクトにアクセスできます。これにより、不要なサーバー呼び出しを防ぐことができます。
以下のいずれかの方法でFunctionインスタンスを作成できます:
i. Function IDを渡す方法
Functionの一意のFunction IDを引数としてgetFunctionInstance()メソッドに渡し、インスタンスを作成できます:
copy
ZCatalystApp.shared.getFunctionInstance( id : Int64 ) -> ZCatalystFunction
パラメータ:
- id: Functionの一意のFunction IDです。
サンプルコードスニペットを以下に示します:
copy
let function_instance = ZCatalystApp.shared.getFunctionInstance ( id : 1096000000002053 ) //ここに関数IDを入力してください
ii. Function名を渡す方法
FunctionのAPI名を引数としてgetFunctionInstance()メソッドに渡し、インスタンスを作成できます:
copy
ZCatalystApp.shared.getFunctionInstance( name : String ) -> ZCatalystFunction
パラメータ:
- name: Catalystで設定されたFunctionの名前です。
サンプルコードスニペットを以下に示します:
copy
let function_instance = ZCatalystApp.shared.getFunctionInstance ( name : "LocalBackup") //ここに関数名を入力してください
最終更新日 2026-03-30 13:40:30 +0530 IST
Yes
No
Send your feedback to us
Skip
Submit