Expo

Get Started
API Reference

IntentLauncher

expo-intent-launcher provides a way to launch Android intents. For example, you can use this API to open a specific settings screen.

Platform Compatibility

Android DeviceAndroid EmulatoriOS DeviceiOS SimulatorWeb

Installation

expo install expo-intent-launcher

If you're installing this in a bare React Native app, you should also follow these additional installation instructions.

import { startActivityAsync, ActivityAction } from 'expo-intent-launcher';

// Open location settings
startActivityAsync(ActivityAction.LOCATION_SOURCE_SETTINGS);

import * as IntentLauncher from 'expo-intent-launcher';

  • activityAction (ActivityAction) - The action to be performed, e.g. IntentLauncher.ActivityAction.WIRELESS_SETTINGS. There are a few pre-defined constants you can use for this parameter. You can find them at expo-intent-launcher/src/IntentLauncher.ts.
  • params (IntentLauncherParams) - An object of intent parameters.

Starts the specified activity. The method will return a promise which resolves when the user returns to the app.

  • Promise<IntentLauncherResult>

A promise which fulfils with IntentLauncherResult object.

NameTypeDescription
category
(optional)
stringCategory provides more details about the action the intent performs. See Intent.addCategory.
className
(optional)
stringClass name of the ComponentName.
data
(optional)
stringA URI specifying the data that the intent should operate upon. (Note: Android requires the URI scheme to be lowercase, unlike the formal RFC.)
extra
(optional)
Record<string, any>A map specifying additional key-value pairs which are passed with the intent as extras. The keys must include a package prefix, for example the app com.android.contacts would use names like com.android.contacts.ShowAll.
flags
(optional)
numberBitmask of flags to be used. See Intent.setFlags for more details.
packageName
(optional)
stringPackage name used as an identifier of ComponentName. Set this only if you want to explicitly set the component to handle the intent.
type
(optional)
stringA string specifying the MIME type of the data represented by the data parameter. Ignore this argument to allow Android to infer the correct MIME type.

NameTypeDescription
data
(optional)
stringOptional data URI that can be returned by the activity.
extra
(optional)
objectOptional extras object that can be returned by the activity.
resultCodeResultCodeResult code returned by the activity.

Constants are from the source code of Settings provider.

  • ActivityAction.ACCESSIBILITY_SETTINGS : "android.settings.ACCESSIBILITY_SETTINGS"
  • ActivityAction.ADD_ACCOUNT_SETTINGS : "android.settings.ADD_ACCOUNT_SETTINGS"
  • ActivityAction.AIRPLANE_MODE_SETTINGS : "android.settings.AIRPLANE_MODE_SETTINGS"
  • ActivityAction.APN_SETTINGS : "android.settings.APN_SETTINGS"
  • ActivityAction.APPLICATION_DETAILS_SETTINGS : "android.settings.APPLICATION_DETAILS_SETTINGS"
  • ActivityAction.APPLICATION_DEVELOPMENT_SETTINGS : "android.settings.APPLICATION_DEVELOPMENT_SETTINGS"
  • ActivityAction.APPLICATION_SETTINGS : "android.settings.APPLICATION_SETTINGS"
  • ActivityAction.APP_NOTIFICATION_REDACTION : "android.settings.ACTION_APP_NOTIFICATION_REDACTION"
  • ActivityAction.APP_NOTIFICATION_SETTINGS : "android.settings.APP_NOTIFICATION_SETTINGS"
  • ActivityAction.APP_OPS_SETTINGS : "android.settings.APP_OPS_SETTINGS"
  • ActivityAction.BATTERY_SAVER_SETTINGS : "android.settings.BATTERY_SAVER_SETTINGS"
  • ActivityAction.BLUETOOTH_SETTINGS : "android.settings.BLUETOOTH_SETTINGS"
  • ActivityAction.CAPTIONING_SETTINGS : "android.settings.CAPTIONING_SETTINGS"
  • ActivityAction.CAST_SETTINGS : "android.settings.CAST_SETTINGS"
  • ActivityAction.CONDITION_PROVIDER_SETTINGS : "android.settings.ACTION_CONDITION_PROVIDER_SETTINGS"
  • ActivityAction.DATA_ROAMING_SETTINGS : "android.settings.DATA_ROAMING_SETTINGS"
  • ActivityAction.DATE_SETTINGS : "android.settings.DATE_SETTINGS"
  • ActivityAction.DEVICE_INFO_SETTINGS : "android.settings.DEVICE_INFO_SETTINGS"
  • ActivityAction.DEVICE_NAME : "android.settings.DEVICE_NAME"
  • ActivityAction.DISPLAY_SETTINGS : "android.settings.DISPLAY_SETTINGS"
  • ActivityAction.DREAM_SETTINGS : "android.settings.DREAM_SETTINGS"
  • ActivityAction.HARD_KEYBOARD_SETTINGS : "android.settings.HARD_KEYBOARD_SETTINGS"
  • ActivityAction.HOME_SETTINGS : "android.settings.HOME_SETTINGS"
  • ActivityAction.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS : "android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS"
  • ActivityAction.IGNORE_BATTERY_OPTIMIZATION_SETTINGS : "android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS"
  • ActivityAction.INPUT_METHOD_SETTINGS : "android.settings.INPUT_METHOD_SETTINGS"
  • ActivityAction.INPUT_METHOD_SUBTYPE_SETTINGS : "android.settings.INPUT_METHOD_SUBTYPE_SETTINGS"
  • ActivityAction.INTERNAL_STORAGE_SETTINGS : "android.settings.INTERNAL_STORAGE_SETTINGS"
  • ActivityAction.LOCALE_SETTINGS : "android.settings.LOCALE_SETTINGS"
  • ActivityAction.LOCATION_SOURCE_SETTINGS : "android.settings.LOCATION_SOURCE_SETTINGS"
  • ActivityAction.MANAGE_ALL_APPLICATIONS_SETTINGS : "android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS"
  • ActivityAction.MANAGE_APPLICATIONS_SETTINGS : "android.settings.MANAGE_APPLICATIONS_SETTINGS"
  • ActivityAction.MANAGE_DEFAULT_APPS_SETTINGS : "android.settings.MANAGE_DEFAULT_APPS_SETTINGS"
  • ActivityAction.MEMORY_CARD_SETTINGS : "android.settings.MEMORY_CARD_SETTINGS"
  • ActivityAction.MONITORING_CERT_INFO : "android.settings.MONITORING_CERT_INFO"
  • ActivityAction.NETWORK_OPERATOR_SETTINGS : "android.settings.NETWORK_OPERATOR_SETTINGS"
  • ActivityAction.NFCSHARING_SETTINGS : "android.settings.NFCSHARING_SETTINGS"
  • ActivityAction.NFC_PAYMENT_SETTINGS : "android.settings.NFC_PAYMENT_SETTINGS"
  • ActivityAction.NFC_SETTINGS : "android.settings.NFC_SETTINGS"
  • ActivityAction.NIGHT_DISPLAY_SETTINGS : "android.settings.NIGHT_DISPLAY_SETTINGS"
  • ActivityAction.NOTIFICATION_LISTENER_SETTINGS : "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"
  • ActivityAction.NOTIFICATION_POLICY_ACCESS_SETTINGS : "android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS"
  • ActivityAction.NOTIFICATION_SETTINGS : "android.settings.NOTIFICATION_SETTINGS"
  • ActivityAction.PAIRING_SETTINGS : "android.settings.PAIRING_SETTINGS"
  • ActivityAction.PRINT_SETTINGS : "android.settings.ACTION_PRINT_SETTINGS"
  • ActivityAction.PRIVACY_SETTINGS : "android.settings.PRIVACY_SETTINGS"
  • ActivityAction.QUICK_LAUNCH_SETTINGS : "android.settings.QUICK_LAUNCH_SETTINGS"
  • ActivityAction.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS : "android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"
  • ActivityAction.SECURITY_SETTINGS : "android.settings.SECURITY_SETTINGS"
  • ActivityAction.SETTINGS : "android.settings.SETTINGS"
  • ActivityAction.SHOW_ADMIN_SUPPORT_DETAILS : "android.settings.SHOW_ADMIN_SUPPORT_DETAILS"
  • ActivityAction.SHOW_INPUT_METHOD_PICKER : "android.settings.SHOW_INPUT_METHOD_PICKER"
  • ActivityAction.SHOW_REGULATORY_INFO : "android.settings.SHOW_REGULATORY_INFO"
  • ActivityAction.SHOW_REMOTE_BUGREPORT_DIALOG : "android.settings.SHOW_REMOTE_BUGREPORT_DIALOG"
  • ActivityAction.SOUND_SETTINGS : "android.settings.SOUND_SETTINGS"
  • ActivityAction.STORAGE_MANAGER_SETTINGS : "android.settings.STORAGE_MANAGER_SETTINGS"
  • ActivityAction.SYNC_SETTINGS : "android.settings.SYNC_SETTINGS"
  • ActivityAction.SYSTEM_UPDATE_SETTINGS : "android.settings.SYSTEM_UPDATE_SETTINGS"
  • ActivityAction.TETHER_PROVISIONING_UI : "android.settings.TETHER_PROVISIONING_UI"
  • ActivityAction.TRUSTED_CREDENTIALS_USER : "android.settings.TRUSTED_CREDENTIALS_USER"
  • ActivityAction.USAGE_ACCESS_SETTINGS : "android.settings.USAGE_ACCESS_SETTINGS"
  • ActivityAction.USER_DICTIONARY_INSERT : "android.settings.USER_DICTIONARY_INSERT"
  • ActivityAction.USER_DICTIONARY_SETTINGS : "android.settings.USER_DICTIONARY_SETTINGS"
  • ActivityAction.USER_SETTINGS : "android.settings.USER_SETTINGS"
  • ActivityAction.VOICE_CONTROL_AIRPLANE_MODE : "android.settings.VOICE_CONTROL_AIRPLANE_MODE"
  • ActivityAction.VOICE_CONTROL_BATTERY_SAVER_MODE : "android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE"
  • ActivityAction.VOICE_CONTROL_DO_NOT_DISTURB_MODE : "android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE"
  • ActivityAction.VOICE_INPUT_SETTINGS : "android.settings.VOICE_INPUT_SETTINGS"
  • ActivityAction.VPN_SETTINGS : "android.settings.VPN_SETTINGS"
  • ActivityAction.VR_LISTENER_SETTINGS : "android.settings.VR_LISTENER_SETTINGS"
  • ActivityAction.WEBVIEW_SETTINGS : "android.settings.WEBVIEW_SETTINGS"
  • ActivityAction.WIFI_IP_SETTINGS : "android.settings.WIFI_IP_SETTINGS"
  • ActivityAction.WIFI_SETTINGS : "android.settings.WIFI_SETTINGS"
  • ActivityAction.WIRELESS_SETTINGS : "android.settings.WIRELESS_SETTINGS"
  • ActivityAction.ZEN_MODE_AUTOMATION_SETTINGS : "android.settings.ZEN_MODE_AUTOMATION_SETTINGS"
  • ActivityAction.ZEN_MODE_EVENT_RULE_SETTINGS : "android.settings.ZEN_MODE_EVENT_RULE_SETTINGS"
  • ActivityAction.ZEN_MODE_EXTERNAL_RULE_SETTINGS : "android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS"
  • ActivityAction.ZEN_MODE_PRIORITY_SETTINGS : "android.settings.ZEN_MODE_PRIORITY_SETTINGS"
  • ActivityAction.ZEN_MODE_SCHEDULE_RULE_SETTINGS : "android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS"
  • ActivityAction.ZEN_MODE_SETTINGS : "android.settings.ZEN_MODE_SETTINGS"

  • ResultCode.Success : -1 - Indicates that the activity operation succeeded.
  • ResultCode.Canceled : 0 - Means that the activity was canceled, e.g. by tapping on the back button.
  • ResultCode.FirstUser : 1 - First custom, user-defined value that can be returned by the activity.