UNPKG

8.02 kBJavaScriptView Raw
1import { UnavailabilityError } from '@unimodules/core';
2import ExpoIntentLauncher from './ExpoIntentLauncher';
3/**
4 * Constants are from the source code of Settings:
5 * https://developer.android.com/reference/android/provider/Settings.html
6 */
7export const ACTION_ACCESSIBILITY_SETTINGS = 'android.settings.ACCESSIBILITY_SETTINGS';
8export const ACTION_APP_NOTIFICATION_REDACTION = 'android.settings.ACTION_APP_NOTIFICATION_REDACTION';
9export const ACTION_CONDITION_PROVIDER_SETTINGS = 'android.settings.ACTION_CONDITION_PROVIDER_SETTINGS';
10export const ACTION_NOTIFICATION_LISTENER_SETTINGS = 'android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS';
11export const ACTION_PRINT_SETTINGS = 'android.settings.ACTION_PRINT_SETTINGS';
12export const ACTION_ADD_ACCOUNT_SETTINGS = 'android.settings.ADD_ACCOUNT_SETTINGS';
13export const ACTION_AIRPLANE_MODE_SETTINGS = 'android.settings.AIRPLANE_MODE_SETTINGS';
14export const ACTION_APN_SETTINGS = 'android.settings.APN_SETTINGS';
15export const ACTION_APPLICATION_DETAILS_SETTINGS = 'android.settings.APPLICATION_DETAILS_SETTINGS';
16export const ACTION_APPLICATION_DEVELOPMENT_SETTINGS = 'android.settings.APPLICATION_DEVELOPMENT_SETTINGS';
17export const ACTION_APPLICATION_SETTINGS = 'android.settings.APPLICATION_SETTINGS';
18export const ACTION_APP_NOTIFICATION_SETTINGS = 'android.settings.APP_NOTIFICATION_SETTINGS';
19export const ACTION_APP_OPS_SETTINGS = 'android.settings.APP_OPS_SETTINGS';
20export const ACTION_BATTERY_SAVER_SETTINGS = 'android.settings.BATTERY_SAVER_SETTINGS';
21export const ACTION_BLUETOOTH_SETTINGS = 'android.settings.BLUETOOTH_SETTINGS';
22export const ACTION_CAPTIONING_SETTINGS = 'android.settings.CAPTIONING_SETTINGS';
23export const ACTION_CAST_SETTINGS = 'android.settings.CAST_SETTINGS';
24export const ACTION_DATA_ROAMING_SETTINGS = 'android.settings.DATA_ROAMING_SETTINGS';
25export const ACTION_DATE_SETTINGS = 'android.settings.DATE_SETTINGS';
26export const ACTION_DEVICE_INFO_SETTINGS = 'android.settings.DEVICE_INFO_SETTINGS';
27export const ACTION_DEVICE_NAME = 'android.settings.DEVICE_NAME';
28export const ACTION_DISPLAY_SETTINGS = 'android.settings.DISPLAY_SETTINGS';
29export const ACTION_DREAM_SETTINGS = 'android.settings.DREAM_SETTINGS';
30export const ACTION_HARD_KEYBOARD_SETTINGS = 'android.settings.HARD_KEYBOARD_SETTINGS';
31export const ACTION_HOME_SETTINGS = 'android.settings.HOME_SETTINGS';
32export const ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS = 'android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS';
33export const ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS = 'android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS';
34export const ACTION_INPUT_METHOD_SETTINGS = 'android.settings.INPUT_METHOD_SETTINGS';
35export const ACTION_INPUT_METHOD_SUBTYPE_SETTINGS = 'android.settings.INPUT_METHOD_SUBTYPE_SETTINGS';
36export const ACTION_INTERNAL_STORAGE_SETTINGS = 'android.settings.INTERNAL_STORAGE_SETTINGS';
37export const ACTION_LOCALE_SETTINGS = 'android.settings.LOCALE_SETTINGS';
38export const ACTION_LOCATION_SOURCE_SETTINGS = 'android.settings.LOCATION_SOURCE_SETTINGS';
39export const ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS = 'android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS';
40export const ACTION_MANAGE_APPLICATIONS_SETTINGS = 'android.settings.MANAGE_APPLICATIONS_SETTINGS';
41export const ACTION_MANAGE_DEFAULT_APPS_SETTINGS = 'android.settings.MANAGE_DEFAULT_APPS_SETTINGS';
42export const ACTION_MEMORY_CARD_SETTINGS = 'android.settings.MEMORY_CARD_SETTINGS';
43export const ACTION_MONITORING_CERT_INFO = 'android.settings.MONITORING_CERT_INFO';
44export const ACTION_NETWORK_OPERATOR_SETTINGS = 'android.settings.NETWORK_OPERATOR_SETTINGS';
45export const ACTION_NFCSHARING_SETTINGS = 'android.settings.NFCSHARING_SETTINGS';
46export const ACTION_NFC_PAYMENT_SETTINGS = 'android.settings.NFC_PAYMENT_SETTINGS';
47export const ACTION_NFC_SETTINGS = 'android.settings.NFC_SETTINGS';
48export const ACTION_NIGHT_DISPLAY_SETTINGS = 'android.settings.NIGHT_DISPLAY_SETTINGS';
49export const ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS = 'android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS';
50export const ACTION_NOTIFICATION_SETTINGS = 'android.settings.NOTIFICATION_SETTINGS';
51export const ACTION_PAIRING_SETTINGS = 'android.settings.PAIRING_SETTINGS';
52export const ACTION_PRIVACY_SETTINGS = 'android.settings.PRIVACY_SETTINGS';
53export const ACTION_QUICK_LAUNCH_SETTINGS = 'android.settings.QUICK_LAUNCH_SETTINGS';
54export const ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS = 'android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS';
55export const ACTION_SECURITY_SETTINGS = 'android.settings.SECURITY_SETTINGS';
56export const ACTION_SETTINGS = 'android.settings.SETTINGS';
57export const ACTION_SHOW_ADMIN_SUPPORT_DETAILS = 'android.settings.SHOW_ADMIN_SUPPORT_DETAILS';
58export const ACTION_SHOW_INPUT_METHOD_PICKER = 'android.settings.SHOW_INPUT_METHOD_PICKER';
59export const ACTION_SHOW_REGULATORY_INFO = 'android.settings.SHOW_REGULATORY_INFO';
60export const ACTION_SHOW_REMOTE_BUGREPORT_DIALOG = 'android.settings.SHOW_REMOTE_BUGREPORT_DIALOG';
61export const ACTION_SOUND_SETTINGS = 'android.settings.SOUND_SETTINGS';
62export const ACTION_STORAGE_MANAGER_SETTINGS = 'android.settings.STORAGE_MANAGER_SETTINGS';
63export const ACTION_SYNC_SETTINGS = 'android.settings.SYNC_SETTINGS';
64export const ACTION_SYSTEM_UPDATE_SETTINGS = 'android.settings.SYSTEM_UPDATE_SETTINGS';
65export const ACTION_TETHER_PROVISIONING_UI = 'android.settings.TETHER_PROVISIONING_UI';
66export const ACTION_TRUSTED_CREDENTIALS_USER = 'android.settings.TRUSTED_CREDENTIALS_USER';
67export const ACTION_USAGE_ACCESS_SETTINGS = 'android.settings.USAGE_ACCESS_SETTINGS';
68export const ACTION_USER_DICTIONARY_INSERT = 'android.settings.USER_DICTIONARY_INSERT';
69export const ACTION_USER_DICTIONARY_SETTINGS = 'android.settings.USER_DICTIONARY_SETTINGS';
70export const ACTION_USER_SETTINGS = 'android.settings.USER_SETTINGS';
71export const ACTION_VOICE_CONTROL_AIRPLANE_MODE = 'android.settings.VOICE_CONTROL_AIRPLANE_MODE';
72export const ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE = 'android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE';
73export const ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE = 'android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE';
74export const ACTION_VOICE_INPUT_SETTINGS = 'android.settings.VOICE_INPUT_SETTINGS';
75export const ACTION_VPN_SETTINGS = 'android.settings.VPN_SETTINGS';
76export const ACTION_VR_LISTENER_SETTINGS = 'android.settings.VR_LISTENER_SETTINGS';
77export const ACTION_WEBVIEW_SETTINGS = 'android.settings.WEBVIEW_SETTINGS';
78export const ACTION_WIFI_IP_SETTINGS = 'android.settings.WIFI_IP_SETTINGS';
79export const ACTION_WIFI_SETTINGS = 'android.settings.WIFI_SETTINGS';
80export const ACTION_WIRELESS_SETTINGS = 'android.settings.WIRELESS_SETTINGS';
81export const ACTION_ZEN_MODE_AUTOMATION_SETTINGS = 'android.settings.ZEN_MODE_AUTOMATION_SETTINGS';
82export const ACTION_ZEN_MODE_EVENT_RULE_SETTINGS = 'android.settings.ZEN_MODE_EVENT_RULE_SETTINGS';
83export const ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS = 'android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS';
84export const ACTION_ZEN_MODE_PRIORITY_SETTINGS = 'android.settings.ZEN_MODE_PRIORITY_SETTINGS';
85export const ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS = 'android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS';
86export const ACTION_ZEN_MODE_SETTINGS = 'android.settings.ZEN_MODE_SETTINGS';
87export var ResultCode;
88(function (ResultCode) {
89 ResultCode[ResultCode["Success"] = -1] = "Success";
90 ResultCode[ResultCode["Canceled"] = 0] = "Canceled";
91 ResultCode[ResultCode["FirstUser"] = 1] = "FirstUser";
92})(ResultCode || (ResultCode = {}));
93export async function startActivityAsync(activityAction, params = {}) {
94 if (!ExpoIntentLauncher.startActivity) {
95 throw new UnavailabilityError('IntentLauncher', 'startActivityAsync');
96 }
97 if (typeof activityAction !== 'string' || !activityAction) {
98 throw new TypeError(`'activityAction' argument must be a non-empty string!`);
99 }
100 return ExpoIntentLauncher.startActivity(activityAction, params);
101}
102//# sourceMappingURL=IntentLauncher.js.map
\No newline at end of file