Skip to main content

Using Android Intent Plus

Use it by specifying action, category, data and extra arguments for the intent. It does not support returning the result of the launched activity. Sample usage:

if (platform.isAndroid) {
AndroidIntent intent = AndroidIntent(
action: 'action_view',
data: ''
arguments: {'authAccount': currentUserEmail},
await intent.launch();

See documentation on the AndroidIntent class for details on each parameter.

Action parameter can be any action including a custom class name to be invoked. If a standard android action is required, the recommendation is to add support for it in the plugin and use an action constant to refer to it. For instance:

'action_view' translates to android.os.Intent.ACTION_VIEW

'action_location_source_settings' translates to android.settings.LOCATION_SOURCE_SETTINGS

'action_application_details_settings' translates to android.settings.ACTION_APPLICATION_DETAILS_SETTINGS

if (platform.isAndroid) {
final AndroidIntent intent = AndroidIntent(
action: 'action_application_details_settings',
data: '', // replace with your applicationId
await intent.launch();

Feel free to add support for additional Android intents.

The Dart values supported for the arguments parameter, and their corresponding Android values, are listed here. On the Android side, the arguments are used to populate an Android Bundle instance. This process currently restricts the use of lists to homogeneous lists of integers or strings.

Note that a similar method does not currently exist for iOS. Instead, the url_launcher plugin can be used for deep linking. Url launcher can also be used for creating ACTION_VIEW intents for Android, however this intent plugin also allows clients to set extra parameters for the intent.

Android 11 package visibility

Android 11 introduced new permissions for package visibility. If you plan to use canResolveActivity() method, you need to specify queries in AndroidManifest.xml with specific package names:

you can read more about package visibility on Android on Android Developers blog:

or Official Documentation

please note that some packages are visible automatically and you don't have to specify queries: