# ExecuteAppFunctionRequest

Artifact: [androidx.appfunctions:appfunctions](https://developer.android.com/jetpack/androidx/releases/appfunctions) [View Source](https://cs.android.com/search?q=file:androidx/appfunctions/ExecuteAppFunctionRequest.kt+class:androidx.appfunctions.ExecuteAppFunctionRequest) Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

*** ** * ** ***


```
public final class ExecuteAppFunctionRequest
```

<br />

*** ** * ** ***

Represents a request to execute a specific app function.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest#ExecuteAppFunctionRequest(kotlin.String,kotlin.String,androidx.appfunctions.AppFunctionData)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html targetPackageName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html functionIdentifier, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/AppFunctionData functionParameters )` Creates a new `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest`. |
| `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 37) https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest#ExecuteAppFunctionRequest(kotlin.String,kotlin.String,androidx.appfunctions.AppFunctionData,android.app.AppInteractionAttribution,android.app.appfunctions.AppFunctionActivityId)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html targetPackageName, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html functionIdentifier, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/AppFunctionData functionParameters, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/AppInteractionAttribution.html attribution, https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html activityId )` Creates a new `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest` with attribution. |

| ### Public methods |
|---|---|
| `final https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 37) https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest#getActivityId()()` The `https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html` for this request. |
| `final https://developer.android.com/reference/android/app/AppInteractionAttribution.html` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 37) https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest#getAttribution()()` The attribution that can be used by the privacy setting to provide transparency to the user about why an app function was invoked. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest#getFunctionIdentifier()()` The unique string identifier of the app function to be executed. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/AppFunctionData` | `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest#getFunctionParameters()()` The parameters required to invoke this function. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest#getTargetPackageName()()` The package name of the app that hosts the function. |
| `static final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 36) https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest#(android.app.appfunctions.ExecuteAppFunctionRequest).toCompatExecuteAppFunctionRequest(androidx.appfunctions.metadata.AppFunctionMetadata)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html receiver, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata functionMetadata )` Creates a `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest` from `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html`. |
| `final @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html` | `@https://developer.android.com/reference/androidx/annotation/RequiresApi(value = 36) https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest#toPlatformExecuteAppFunctionRequest()()` Converts `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest` to `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html`. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest#toString()()` |

## Public constructors

### ExecuteAppFunctionRequest

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
public ExecuteAppFunctionRequest(
    @NonNull String targetPackageName,
    @NonNull String functionIdentifier,
    @NonNull AppFunctionData functionParameters
)
```

Creates a new `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html targetPackageName` | The package name of the app that hosts the function. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html functionIdentifier` | The unique string identifier of the app function to be executed. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/AppFunctionData functionParameters` | The parameters required to invoke this function. Within this `https://developer.android.com/reference/androidx/appfunctions/AppFunctionData`, the property names are the names of the function parameters and the property values are the values of those parameters. The data object may have missing parameters. Developers are advised to implement defensive handling measures. |

### ExecuteAppFunctionRequest

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
@RequiresApi(value = 37)
public ExecuteAppFunctionRequest(
    @NonNull String targetPackageName,
    @NonNull String functionIdentifier,
    @NonNull AppFunctionData functionParameters,
    @NonNull AppInteractionAttribution attribution,
    AppFunctionActivityId activityId
)
```

Creates a new `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest` with attribution.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html targetPackageName` | The package name of the app that hosts the function. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html functionIdentifier` | The unique string identifier of the app function to be executed. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/AppFunctionData functionParameters` | The parameters required to invoke this function. Within this `https://developer.android.com/reference/androidx/appfunctions/AppFunctionData`, the property names are the names of the function parameters and the property values are the values of those parameters. The data object may have missing parameters. Developers are advised to implement defensive handling measures. |
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/AppInteractionAttribution.html attribution` | The attribution that can be used by the privacy setting to provide transparency to the user about why an app function was invoked. |
| `https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html activityId` | The `https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html` for this request. This identifier is used to disambiguate between instances of the same app function running in different activities when the function's `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata#scope()` is `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata#SCOPE_ACTIVITY()`. If the property's value is `null`, the request targets an app function that is not `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata#SCOPE_ACTIVITY()`. |

## Public methods

### getActivityId

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
@RequiresApi(value = 37)
public final AppFunctionActivityId getActivityId()
```

The `https://developer.android.com/reference/android/app/appfunctions/AppFunctionActivityId.html` for this request.

This identifier is used to disambiguate between instances of the same app function running in different activities when the function's `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata#scope()` is `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata#SCOPE_ACTIVITY()`.

If the property's value is `null`, the request targets an app function that is not `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata#SCOPE_ACTIVITY()`.

### getAttribution

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
@RequiresApi(value = 37)
public final AppInteractionAttribution getAttribution()
```

The attribution that can be used by the privacy setting to provide transparency to the user about why an app function was invoked.

### getFunctionIdentifier

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
public final @NonNull String getFunctionIdentifier()
```

The unique string identifier of the app function to be executed.

### getFunctionParameters

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
public final @NonNull AppFunctionData getFunctionParameters()
```

The parameters required to invoke this function. Within this `https://developer.android.com/reference/androidx/appfunctions/AppFunctionData`, the property names are the names of the function parameters and the property values are the values of those parameters.

The data object may have missing parameters. Developers are advised to implement defensive handling measures.

### getTargetPackageName

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
public final @NonNull String getTargetPackageName()
```

The package name of the app that hosts the function.

### toCompatExecuteAppFunctionRequest

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
@RequiresApi(value = 36)
public static final @NonNull ExecuteAppFunctionRequest toCompatExecuteAppFunctionRequest(
    @NonNull ExecuteAppFunctionRequest receiver,
    @NonNull AppFunctionMetadata functionMetadata
)
```

Creates a `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest` from `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html`.

The provided `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata` is used to validate the created `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest`.

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata functionMetadata` | the `https://developer.android.com/reference/androidx/appfunctions/metadata/AppFunctionMetadata` of the function to be executed. |

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest` | The created `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest`. |

### toPlatformExecuteAppFunctionRequest

Added in [1.0.0-rc01](https://developer.android.com/jetpack/androidx/releases/appfunctions#1.0.0-rc01)

```
@RequiresApi(value = 36)
public final @NonNull ExecuteAppFunctionRequest toPlatformExecuteAppFunctionRequest()
```

Converts `https://developer.android.com/reference/androidx/appfunctions/ExecuteAppFunctionRequest` to `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html`.

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html` | The converted `https://developer.android.com/reference/android/app/appfunctions/ExecuteAppFunctionRequest.html`. |

### toString

```
public @NonNull String toString()
```