AppFunctionService.OnExecuteFunction メソッド

定義

特定のアプリ関数を実行するためにシステムによって呼び出されます。

[Android.Runtime.Register("onExecuteFunction", "(Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/lang/String;Landroid/content/pm/SigningInfo;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "GetOnExecuteFunction_Landroid_app_appfunctions_ExecuteAppFunctionRequest_Ljava_lang_String_Landroid_content_pm_SigningInfo_Landroid_os_CancellationSignal_Landroid_os_OutcomeReceiver_Handler", ApiSince=36)]
public abstract void OnExecuteFunction(Android.App.AppFunctions.ExecuteAppFunctionRequest request, string callingPackage, Android.Content.PM.SigningInfo callingPackageSigningInfo, Android.OS.CancellationSignal cancellationSignal, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("onExecuteFunction", "(Landroid/app/appfunctions/ExecuteAppFunctionRequest;Ljava/lang/String;Landroid/content/pm/SigningInfo;Landroid/os/CancellationSignal;Landroid/os/OutcomeReceiver;)V", "GetOnExecuteFunction_Landroid_app_appfunctions_ExecuteAppFunctionRequest_Ljava_lang_String_Landroid_content_pm_SigningInfo_Landroid_os_CancellationSignal_Landroid_os_OutcomeReceiver_Handler", ApiSince=36)>]
abstract member OnExecuteFunction : Android.App.AppFunctions.ExecuteAppFunctionRequest * string * Android.Content.PM.SigningInfo * Android.OS.CancellationSignal * Android.OS.IOutcomeReceiver -> unit

パラメーター

request
ExecuteAppFunctionRequest

関数の実行要求。

callingPackage
String

実行を要求しているアプリのパッケージ名。

callingPackageSigningInfo
SigningInfo

実行を要求しているアプリの署名情報。

cancellationSignal
CancellationSignal

実行を取り消すシグナル。

callback
IOutcomeReceiver

結果またはエラーを報告するコールバック。

属性

注釈

特定のアプリ関数を実行するためにシステムによって呼び出されます。

このメソッドは、アプリ内のすべてのアプリ関数要求を処理するためのエントリ ポイントです。 システムが関数を実行するために AppFunctionService を必要とする場合は、このメソッドを呼び出します。

登録した各関数は、一意の識別子によって識別されます。 この識別子はグローバルに一意である必要はありませんが、アプリ内で一意である必要があります。 たとえば、食品を注文する関数は、"orderFood" として識別できます。 ほとんどの場合、この識別子は AppFunctions SDK によって自動的に生成されます。

ExecuteAppFunctionRequest#getFunctionIdentifier()を呼び出すことによって、実行する関数を決定できます。 これにより、サービスは、特定の関数を処理するための適切なロジックに受信要求をルーティングできます。

このメソッドは、常にメイン スレッドでトリガーされます。 ワーカー スレッドで重いタスクを実行し、指定されたコールバックを使用して結果をディスパッチする必要があります。 実行が成功したかどうかに関係なく、コールバックを使用して常に結果を報告する必要があります。

このメソッドは、システムから要求された場合に、アプリが関数の実行の取り消しをリッスンする必要がある CancellationSignal も受け入れます。

Javaドキュメント。

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象