1 |
|
2 |
|
3 | import { NativeModules, Platform } from 'react-native';
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | export const ACTION_ACCESSIBILITY_SETTINGS = 'android.settings.ACCESSIBILITY_SETTINGS';
|
11 | export const ACTION_APP_NOTIFICATION_REDACTION =
|
12 | 'android.settings.ACTION_APP_NOTIFICATION_REDACTION';
|
13 | export const ACTION_CONDITION_PROVIDER_SETTINGS =
|
14 | 'android.settings.ACTION_CONDITION_PROVIDER_SETTINGS';
|
15 | export const ACTION_NOTIFICATION_LISTENER_SETTINGS =
|
16 | 'android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS';
|
17 | export const ACTION_PRINT_SETTINGS = 'android.settings.ACTION_PRINT_SETTINGS';
|
18 | export const ACTION_ADD_ACCOUNT_SETTINGS = 'android.settings.ADD_ACCOUNT_SETTINGS';
|
19 | export const ACTION_AIRPLANE_MODE_SETTINGS = 'android.settings.AIRPLANE_MODE_SETTINGS';
|
20 | export const ACTION_APN_SETTINGS = 'android.settings.APN_SETTINGS';
|
21 | export const ACTION_APPLICATION_DETAILS_SETTINGS = 'android.settings.APPLICATION_DETAILS_SETTINGS';
|
22 | export const ACTION_APPLICATION_DEVELOPMENT_SETTINGS =
|
23 | 'android.settings.APPLICATION_DEVELOPMENT_SETTINGS';
|
24 | export const ACTION_APPLICATION_SETTINGS = 'android.settings.APPLICATION_SETTINGS';
|
25 | export const ACTION_APP_NOTIFICATION_SETTINGS = 'android.settings.APP_NOTIFICATION_SETTINGS';
|
26 | export const ACTION_APP_OPS_SETTINGS = 'android.settings.APP_OPS_SETTINGS';
|
27 | export const ACTION_BATTERY_SAVER_SETTINGS = 'android.settings.BATTERY_SAVER_SETTINGS';
|
28 | export const ACTION_BLUETOOTH_SETTINGS = 'android.settings.BLUETOOTH_SETTINGS';
|
29 | export const ACTION_CAPTIONING_SETTINGS = 'android.settings.CAPTIONING_SETTINGS';
|
30 | export const ACTION_CAST_SETTINGS = 'android.settings.CAST_SETTINGS';
|
31 | export const ACTION_DATA_ROAMING_SETTINGS = 'android.settings.DATA_ROAMING_SETTINGS';
|
32 | export const ACTION_DATE_SETTINGS = 'android.settings.DATE_SETTINGS';
|
33 | export const ACTION_DEVICE_INFO_SETTINGS = 'android.settings.DEVICE_INFO_SETTINGS';
|
34 | export const ACTION_DEVICE_NAME = 'android.settings.DEVICE_NAME';
|
35 | export const ACTION_DISPLAY_SETTINGS = 'android.settings.DISPLAY_SETTINGS';
|
36 | export const ACTION_DREAM_SETTINGS = 'android.settings.DREAM_SETTINGS';
|
37 | export const ACTION_HARD_KEYBOARD_SETTINGS = 'android.settings.HARD_KEYBOARD_SETTINGS';
|
38 | export const ACTION_HOME_SETTINGS = 'android.settings.HOME_SETTINGS';
|
39 | export const ACTION_IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS =
|
40 | 'android.settings.IGNORE_BACKGROUND_DATA_RESTRICTIONS_SETTINGS';
|
41 | export const ACTION_IGNORE_BATTERY_OPTIMIZATION_SETTINGS =
|
42 | 'android.settings.IGNORE_BATTERY_OPTIMIZATION_SETTINGS';
|
43 | export const ACTION_INPUT_METHOD_SETTINGS = 'android.settings.INPUT_METHOD_SETTINGS';
|
44 | export const ACTION_INPUT_METHOD_SUBTYPE_SETTINGS =
|
45 | 'android.settings.INPUT_METHOD_SUBTYPE_SETTINGS';
|
46 | export const ACTION_INTERNAL_STORAGE_SETTINGS = 'android.settings.INTERNAL_STORAGE_SETTINGS';
|
47 | export const ACTION_LOCALE_SETTINGS = 'android.settings.LOCALE_SETTINGS';
|
48 | export const ACTION_LOCATION_SOURCE_SETTINGS = 'android.settings.LOCATION_SOURCE_SETTINGS';
|
49 | export const ACTION_MANAGE_ALL_APPLICATIONS_SETTINGS =
|
50 | 'android.settings.MANAGE_ALL_APPLICATIONS_SETTINGS';
|
51 | export const ACTION_MANAGE_APPLICATIONS_SETTINGS = 'android.settings.MANAGE_APPLICATIONS_SETTINGS';
|
52 | export const ACTION_MANAGE_DEFAULT_APPS_SETTINGS = 'android.settings.MANAGE_DEFAULT_APPS_SETTINGS';
|
53 | export const ACTION_MEMORY_CARD_SETTINGS = 'android.settings.MEMORY_CARD_SETTINGS';
|
54 | export const ACTION_MONITORING_CERT_INFO = 'android.settings.MONITORING_CERT_INFO';
|
55 | export const ACTION_NETWORK_OPERATOR_SETTINGS = 'android.settings.NETWORK_OPERATOR_SETTINGS';
|
56 | export const ACTION_NFCSHARING_SETTINGS = 'android.settings.NFCSHARING_SETTINGS';
|
57 | export const ACTION_NFC_PAYMENT_SETTINGS = 'android.settings.NFC_PAYMENT_SETTINGS';
|
58 | export const ACTION_NFC_SETTINGS = 'android.settings.NFC_SETTINGS';
|
59 | export const ACTION_NIGHT_DISPLAY_SETTINGS = 'android.settings.NIGHT_DISPLAY_SETTINGS';
|
60 | export const ACTION_NOTIFICATION_POLICY_ACCESS_SETTINGS =
|
61 | 'android.settings.NOTIFICATION_POLICY_ACCESS_SETTINGS';
|
62 | export const ACTION_NOTIFICATION_SETTINGS = 'android.settings.NOTIFICATION_SETTINGS';
|
63 | export const ACTION_PAIRING_SETTINGS = 'android.settings.PAIRING_SETTINGS';
|
64 | export const ACTION_PRIVACY_SETTINGS = 'android.settings.PRIVACY_SETTINGS';
|
65 | export const ACTION_QUICK_LAUNCH_SETTINGS = 'android.settings.QUICK_LAUNCH_SETTINGS';
|
66 | export const ACTION_REQUEST_IGNORE_BATTERY_OPTIMIZATIONS =
|
67 | 'android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS';
|
68 | export const ACTION_SECURITY_SETTINGS = 'android.settings.SECURITY_SETTINGS';
|
69 | export const ACTION_SETTINGS = 'android.settings.SETTINGS';
|
70 | export const ACTION_SHOW_ADMIN_SUPPORT_DETAILS = 'android.settings.SHOW_ADMIN_SUPPORT_DETAILS';
|
71 | export const ACTION_SHOW_INPUT_METHOD_PICKER = 'android.settings.SHOW_INPUT_METHOD_PICKER';
|
72 | export const ACTION_SHOW_REGULATORY_INFO = 'android.settings.SHOW_REGULATORY_INFO';
|
73 | export const ACTION_SHOW_REMOTE_BUGREPORT_DIALOG = 'android.settings.SHOW_REMOTE_BUGREPORT_DIALOG';
|
74 | export const ACTION_SOUND_SETTINGS = 'android.settings.SOUND_SETTINGS';
|
75 | export const ACTION_STORAGE_MANAGER_SETTINGS = 'android.settings.STORAGE_MANAGER_SETTINGS';
|
76 | export const ACTION_SYNC_SETTINGS = 'android.settings.SYNC_SETTINGS';
|
77 | export const ACTION_SYSTEM_UPDATE_SETTINGS = 'android.settings.SYSTEM_UPDATE_SETTINGS';
|
78 | export const ACTION_TETHER_PROVISIONING_UI = 'android.settings.TETHER_PROVISIONING_UI';
|
79 | export const ACTION_TRUSTED_CREDENTIALS_USER = 'android.settings.TRUSTED_CREDENTIALS_USER';
|
80 | export const ACTION_USAGE_ACCESS_SETTINGS = 'android.settings.USAGE_ACCESS_SETTINGS';
|
81 | export const ACTION_USER_DICTIONARY_INSERT = 'android.settings.USER_DICTIONARY_INSERT';
|
82 | export const ACTION_USER_DICTIONARY_SETTINGS = 'android.settings.USER_DICTIONARY_SETTINGS';
|
83 | export const ACTION_USER_SETTINGS = 'android.settings.USER_SETTINGS';
|
84 | export const ACTION_VOICE_CONTROL_AIRPLANE_MODE = 'android.settings.VOICE_CONTROL_AIRPLANE_MODE';
|
85 | export const ACTION_VOICE_CONTROL_BATTERY_SAVER_MODE =
|
86 | 'android.settings.VOICE_CONTROL_BATTERY_SAVER_MODE';
|
87 | export const ACTION_VOICE_CONTROL_DO_NOT_DISTURB_MODE =
|
88 | 'android.settings.VOICE_CONTROL_DO_NOT_DISTURB_MODE';
|
89 | export const ACTION_VOICE_INPUT_SETTINGS = 'android.settings.VOICE_INPUT_SETTINGS';
|
90 | export const ACTION_VPN_SETTINGS = 'android.settings.VPN_SETTINGS';
|
91 | export const ACTION_VR_LISTENER_SETTINGS = 'android.settings.VR_LISTENER_SETTINGS';
|
92 | export const ACTION_WEBVIEW_SETTINGS = 'android.settings.WEBVIEW_SETTINGS';
|
93 | export const ACTION_WIFI_IP_SETTINGS = 'android.settings.WIFI_IP_SETTINGS';
|
94 | export const ACTION_WIFI_SETTINGS = 'android.settings.WIFI_SETTINGS';
|
95 | export const ACTION_WIRELESS_SETTINGS = 'android.settings.WIRELESS_SETTINGS';
|
96 | export const ACTION_ZEN_MODE_AUTOMATION_SETTINGS = 'android.settings.ZEN_MODE_AUTOMATION_SETTINGS';
|
97 | export const ACTION_ZEN_MODE_EVENT_RULE_SETTINGS = 'android.settings.ZEN_MODE_EVENT_RULE_SETTINGS';
|
98 | export const ACTION_ZEN_MODE_EXTERNAL_RULE_SETTINGS =
|
99 | 'android.settings.ZEN_MODE_EXTERNAL_RULE_SETTINGS';
|
100 | export const ACTION_ZEN_MODE_PRIORITY_SETTINGS = 'android.settings.ZEN_MODE_PRIORITY_SETTINGS';
|
101 | export const ACTION_ZEN_MODE_SCHEDULE_RULE_SETTINGS =
|
102 | 'android.settings.ZEN_MODE_SCHEDULE_RULE_SETTINGS';
|
103 | export const ACTION_ZEN_MODE_SETTINGS = 'android.settings.ZEN_MODE_SETTINGS';
|
104 |
|
105 | export function startActivityAsync(activity: string, data: ?Object = null): Promise<boolean> {
|
106 | if (Platform.OS === 'android') {
|
107 | return NativeModules.ExponentIntentLauncher.startActivity(activity, data);
|
108 | } else {
|
109 | return Promise.reject(new Error('Unsupported platform'));
|
110 | }
|
111 | }
|