IApp.Invoke Method

Definition

Overloads

Invoke(String, Object[])

Invokes a method on the app's main activity for Android and app delegate for iOS. For Xamarin apps, methods must be exposed using attributes as shown below.

Android example in activity:

[Export]
public string MyInvokeMethod(string arg, string arg2)
{
    return "uitest";
}

iOS example in app delegate:

[Export("myInvokeMethod:")]
public NSString MyInvokeMethod(NSString arg, NSString arg2)
{
    return new NSString("uitest");
}
Invoke(String, Object)

Invokes a method on the app's main activity for Android and app delegate for iOS. For Xamarin apps, methods must be exposed using attributes as shown below.

Android example in activity:

[Export]
public string MyInvokeMethod(string arg)
{
    return "uitest";
}

iOS example in app delegate:

[Export("myInvokeMethod:")]
public NSString MyInvokeMethod(NSString arg)
{
    return new NSString("uitest");
}

Invoke(String, Object[])

Invokes a method on the app's main activity for Android and app delegate for iOS. For Xamarin apps, methods must be exposed using attributes as shown below.

Android example in activity:

[Export]
public string MyInvokeMethod(string arg, string arg2)
{
    return "uitest";
}

iOS example in app delegate:

[Export("myInvokeMethod:")]
public NSString MyInvokeMethod(NSString arg, NSString arg2)
{
    return new NSString("uitest");
}
public object Invoke (string methodName, object[] arguments);
abstract member Invoke : string * obj[] -> obj
Public Function Invoke (methodName As String, arguments As Object()) As Object

Parameters

methodName
String

The name of the method to invoke.

arguments
Object[]

The arguments to pass to the method.

Returns

Object

The result of the invocation.

Applies to

Invoke(String, Object)

Invokes a method on the app's main activity for Android and app delegate for iOS. For Xamarin apps, methods must be exposed using attributes as shown below.

Android example in activity:

[Export]
public string MyInvokeMethod(string arg)
{
    return "uitest";
}

iOS example in app delegate:

[Export("myInvokeMethod:")]
public NSString MyInvokeMethod(NSString arg)
{
    return new NSString("uitest");
}
public object Invoke (string methodName, object argument = null);
abstract member Invoke : string * obj -> obj
Public Function Invoke (methodName As String, Optional argument As Object = null) As Object

Parameters

methodName
String

The name of the method to invoke.

argument
Object

The argument to pass to the method.

Returns

Object

The result of the invocation.

Applies to