Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

HybridWebView.InvokeJavaScriptAsync Method

Definition

Namespace:
Microsoft.Maui.Controls
Assembly:
Microsoft.Maui.Controls.dll

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
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
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
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 return value from the JavaScript method call to type 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>

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

Implements

Applies to


Feedback

Was this page helpful?