Dela via


HybridWebView.InvokeJavaScriptAsync Method

Definition

Overloads

InvokeJavaScriptAsync(String, Object[], JsonTypeInfo[])

Invokes a JavaScript method named methodName and optionally passes in the parameter values specified by paramValues by JSON-encoding each one.

InvokeJavaScriptAsync<TReturnType>(String, JsonTypeInfo<TReturnType>, Object[], JsonTypeInfo[])

Invokes a JavaScript method named methodName and optionally passes in the parameter values specified by paramValues by JSON-encoding each one.

InvokeJavaScriptAsync(String, Object[], JsonTypeInfo[])

Source:
HybridWebView.cs

Invokes a JavaScript method named methodName and optionally passes in the parameter values specified by paramValues by JSON-encoding each one.

public System.Threading.Tasks.Task InvokeJavaScriptAsync(string methodName, object?[]? paramValues = default, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = default);
member this.InvokeJavaScriptAsync : string * obj[] * System.Text.Json.Serialization.Metadata.JsonTypeInfo[] -> System.Threading.Tasks.Task
Public Function InvokeJavaScriptAsync (methodName As String, Optional paramValues As Object() = Nothing, Optional paramJsonTypeInfos As JsonTypeInfo() = Nothing) As Task

Parameters

methodName
String

The name of the JavaScript method to invoke.

paramValues
Object[]

Optional array of objects to be passed to the JavaScript method by JSON-encoding each one.

paramJsonTypeInfos
JsonTypeInfo[]

Optional array of metadata about serializing the types of the parameters specified by paramValues.

Returns

A Task object with the current status of the asynchronous operation.

Applies to

InvokeJavaScriptAsync<TReturnType>(String, JsonTypeInfo<TReturnType>, Object[], JsonTypeInfo[])

Source:
HybridWebView.cs
Source:
HybridWebView.cs

Invokes a JavaScript method named methodName and optionally passes in the parameter values specified by paramValues by JSON-encoding each one.

public System.Threading.Tasks.Task<TReturnType?> InvokeJavaScriptAsync<TReturnType>(string methodName, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TReturnType> returnTypeJsonTypeInfo, object?[]? paramValues = default, System.Text.Json.Serialization.Metadata.JsonTypeInfo?[]? paramJsonTypeInfos = default);
abstract member InvokeJavaScriptAsync : string * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'ReturnType> * obj[] * System.Text.Json.Serialization.Metadata.JsonTypeInfo[] -> System.Threading.Tasks.Task<'ReturnType>
override this.InvokeJavaScriptAsync : string * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'ReturnType> * obj[] * System.Text.Json.Serialization.Metadata.JsonTypeInfo[] -> System.Threading.Tasks.Task<'ReturnType>
Public Function InvokeJavaScriptAsync(Of TReturnType) (methodName As String, returnTypeJsonTypeInfo As JsonTypeInfo(Of TReturnType), Optional paramValues As Object() = Nothing, Optional paramJsonTypeInfos As JsonTypeInfo() = Nothing) As Task(Of TReturnType)

Type Parameters

TReturnType

The type of the return value.

Parameters

methodName
String

The name of the JavaScript method to invoke.

returnTypeJsonTypeInfo
JsonTypeInfo<TReturnType>

Metadata about deserializing the type of the return value specified by TReturnType.

paramValues
Object[]

Optional array of objects to be passed to the JavaScript method by JSON-encoding each one.

paramJsonTypeInfos
JsonTypeInfo[]

Optional array of metadata about serializing the types of the parameters specified by paramValues.

Returns

Task<TReturnType>

An object of type TReturnType containing the return value of the called method.

Implements

Applies to