cordova.plugins.diagnostic 7.2.10 → 7.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/README.md +465 -372
- package/cordova.plugins.diagnostic.d.ts +40 -0
- package/package.json +1 -1
- package/plugin.xml +1 -1
- package/src/android/Diagnostic.java +78 -0
- package/src/ios/Diagnostic.h +2 -0
- package/src/ios/Diagnostic.m +26 -0
- package/src/ios/Diagnostic_Bluetooth.m +3 -1
- package/www/android/diagnostic.js +59 -1
- package/www/ios/diagnostic.js +27 -1
- package/.specstory/.project.json +0 -8
package/README.md
CHANGED
|
@@ -2,378 +2,382 @@ Cordova diagnostic plugin [
|
|
10
|
-
- [Important notes](#important-notes)
|
|
11
|
-
- [Minimum supported versions](#minimum-supported-versions)
|
|
12
|
-
- [Native environment required](#native-environment-required)
|
|
13
|
-
- [Building for Android](#building-for-android)
|
|
14
|
-
- [Installation](#installation)
|
|
15
|
-
- [Using the Cordova/Phonegap/Ionic CLI](#using-the-cordovaphonegapionic-cli)
|
|
16
|
-
- [AndroidX Library](#androidx-library)
|
|
17
|
-
- [Specifying modules](#specifying-modules)
|
|
18
|
-
- [Available modules](#available-modules)
|
|
19
|
-
- [Reporting issues](#reporting-issues)
|
|
20
|
-
- [Reporting a bug or problem](#reporting-a-bug-or-problem)
|
|
21
|
-
- [Requesting a new feature](#requesting-a-new-feature)
|
|
22
|
-
- [Usage](#usage)
|
|
23
|
-
- [Core module](#core-module)
|
|
24
|
-
- [switchToSettings()](#switchtosettings)
|
|
25
|
-
- [Parameters](#parameters)
|
|
26
|
-
- [Example usage](#example-usage)
|
|
27
|
-
- [switchToWirelessSettings()](#switchtowirelesssettings)
|
|
28
|
-
- [switchToMobileDataSettings()](#switchtomobiledatasettings)
|
|
29
|
-
- [permissionStatus constants](#permissionstatus-constants)
|
|
30
|
-
- [Android](#android)
|
|
31
|
-
- [iOS](#ios)
|
|
32
|
-
- [Example](#example)
|
|
33
|
-
- [getPermissionAuthorizationStatus()](#getpermissionauthorizationstatus)
|
|
34
|
-
- [Parameters](#parameters-1)
|
|
35
|
-
- [Example usage](#example-usage-1)
|
|
36
|
-
- [getPermissionsAuthorizationStatus()](#getpermissionsauthorizationstatus)
|
|
37
|
-
- [Parameters](#parameters-2)
|
|
38
|
-
- [Example usage](#example-usage-2)
|
|
39
|
-
- [requestRuntimePermission()](#requestruntimepermission)
|
|
40
|
-
- [Parameters](#parameters-3)
|
|
41
|
-
- [Example usage](#example-usage-3)
|
|
42
|
-
- [requestRuntimePermissions()](#requestruntimepermissions)
|
|
43
|
-
- [Parameters](#parameters-4)
|
|
44
|
-
- [Example usage](#example-usage-4)
|
|
45
|
-
- [isRequestingPermission()](#isrequestingpermission)
|
|
46
|
-
- [Example usage](#example-usage-5)
|
|
47
|
-
- [registerPermissionRequestCompleteHandler()](#registerpermissionrequestcompletehandler)
|
|
48
|
-
- [Parameters](#parameters-5)
|
|
49
|
-
- [Example usage](#example-usage-6)
|
|
50
|
-
- [isDataRoamingEnabled()](#isdataroamingenabled)
|
|
51
|
-
- [Parameters](#parameters-6)
|
|
52
|
-
- [Example usage](#example-usage-7)
|
|
53
|
-
- [isADBModeEnabled()](#isadbmodeenabled)
|
|
54
|
-
- [Parameters](#parameters-7)
|
|
55
|
-
- [Example usage](#example-usage-8)
|
|
56
|
-
- [isDeviceRooted()](#isdevicerooted)
|
|
57
|
-
- [Parameters](#parameters-8)
|
|
58
|
-
- [Example usage](#example-usage-9)
|
|
59
|
-
- [isBackgroundRefreshAuthorized()](#isbackgroundrefreshauthorized)
|
|
60
|
-
- [Parameters](#parameters-9)
|
|
61
|
-
- [Example usage](#example-usage-10)
|
|
62
|
-
- [getBackgroundRefreshStatus()](#getbackgroundrefreshstatus)
|
|
63
|
-
- [Parameters](#parameters-10)
|
|
64
|
-
- [Example usage](#example-usage-11)
|
|
65
|
-
- [cpuArchitecture constants](#cpuarchitecture-constants)
|
|
66
|
-
- [Android](#android-1)
|
|
67
|
-
- [iOS](#ios-1)
|
|
68
|
-
- [Example usage](#example-usage-12)
|
|
69
|
-
- [getArchitecture()](#getarchitecture)
|
|
70
|
-
- [Parameters](#parameters-11)
|
|
71
|
-
- [Example usage](#example-usage-13)
|
|
72
|
-
- [restart()](#restart)
|
|
73
|
-
- [Parameters](#parameters-12)
|
|
74
|
-
- [Example usage](#example-usage-14)
|
|
75
|
-
- [enableDebug()](#enabledebug)
|
|
76
|
-
- [Parameters](#parameters-13)
|
|
77
|
-
- [Example usage](#example-usage-15)
|
|
78
|
-
- [getCurrentBatteryLevel()](#getcurrentbatterylevel)
|
|
79
|
-
- [Parameters](#parameters-14)
|
|
80
|
-
- [Example usage](#example-usage-16)
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
- [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- [
|
|
105
|
-
|
|
106
|
-
- [
|
|
107
|
-
- [
|
|
108
|
-
- [Example](#example-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
- [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
- [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
- [
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
- [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
- [
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
- [
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
- [
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
- [
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
- [
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
- [
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- [
|
|
144
|
-
- [Example
|
|
145
|
-
- [
|
|
146
|
-
- [Parameters](#parameters-
|
|
147
|
-
|
|
148
|
-
- [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
- [
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
- [
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
- [
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
- [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
- [
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
- [
|
|
169
|
-
- [
|
|
170
|
-
- [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
- [
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
- [
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
- [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
- [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
- [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
- [
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
- [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
- [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- [
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
- [
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
- [
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
- [
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
- [
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
- [
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
- [
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
- [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
- [
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
- [
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
- [
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
- [
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
- [
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
- [
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
- [
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
- [
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
- [
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
- [
|
|
253
|
-
|
|
254
|
-
- [
|
|
255
|
-
- [
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
- [
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
- [
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
- [
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
- [
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
- [
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
- [
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
- [
|
|
282
|
-
|
|
283
|
-
- [
|
|
284
|
-
- [Parameters](#parameters-
|
|
285
|
-
- [Example usage](#example-usage-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
- [
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
- [
|
|
292
|
-
|
|
293
|
-
- [
|
|
294
|
-
- [Parameters](#parameters-
|
|
295
|
-
- [Example usage](#example-usage-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
- [
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
- [
|
|
302
|
-
|
|
303
|
-
- [
|
|
304
|
-
- [Parameters](#parameters-
|
|
305
|
-
- [Example usage](#example-usage-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
- [
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
- [
|
|
312
|
-
|
|
313
|
-
- [
|
|
314
|
-
- [
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
- [
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
- [
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
- [
|
|
327
|
-
|
|
328
|
-
- [
|
|
329
|
-
- [
|
|
330
|
-
- [Example](#example-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
- [
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
- [
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
- [
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
- [
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
- [
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
- [
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
- [
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
- [
|
|
357
|
-
- [
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
- [
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
- [
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
- [iOS](#ios-
|
|
372
|
-
- [
|
|
373
|
-
- [
|
|
374
|
-
- [
|
|
375
|
-
|
|
376
|
-
|
|
5
|
+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
|
|
6
|
+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
- [Overview](#overview)
|
|
10
|
+
- [Important notes](#important-notes)
|
|
11
|
+
- [Minimum supported versions](#minimum-supported-versions)
|
|
12
|
+
- [Native environment required](#native-environment-required)
|
|
13
|
+
- [Building for Android](#building-for-android)
|
|
14
|
+
- [Installation](#installation)
|
|
15
|
+
- [Using the Cordova/Phonegap/Ionic CLI](#using-the-cordovaphonegapionic-cli)
|
|
16
|
+
- [AndroidX Library](#androidx-library)
|
|
17
|
+
- [Specifying modules](#specifying-modules)
|
|
18
|
+
- [Available modules](#available-modules)
|
|
19
|
+
- [Reporting issues](#reporting-issues)
|
|
20
|
+
- [Reporting a bug or problem](#reporting-a-bug-or-problem)
|
|
21
|
+
- [Requesting a new feature](#requesting-a-new-feature)
|
|
22
|
+
- [Usage](#usage)
|
|
23
|
+
- [Core module](#core-module)
|
|
24
|
+
- [switchToSettings()](#switchtosettings)
|
|
25
|
+
- [Parameters](#parameters)
|
|
26
|
+
- [Example usage](#example-usage)
|
|
27
|
+
- [switchToWirelessSettings()](#switchtowirelesssettings)
|
|
28
|
+
- [switchToMobileDataSettings()](#switchtomobiledatasettings)
|
|
29
|
+
- [permissionStatus constants](#permissionstatus-constants)
|
|
30
|
+
- [Android](#android)
|
|
31
|
+
- [iOS](#ios)
|
|
32
|
+
- [Example](#example)
|
|
33
|
+
- [getPermissionAuthorizationStatus()](#getpermissionauthorizationstatus)
|
|
34
|
+
- [Parameters](#parameters-1)
|
|
35
|
+
- [Example usage](#example-usage-1)
|
|
36
|
+
- [getPermissionsAuthorizationStatus()](#getpermissionsauthorizationstatus)
|
|
37
|
+
- [Parameters](#parameters-2)
|
|
38
|
+
- [Example usage](#example-usage-2)
|
|
39
|
+
- [requestRuntimePermission()](#requestruntimepermission)
|
|
40
|
+
- [Parameters](#parameters-3)
|
|
41
|
+
- [Example usage](#example-usage-3)
|
|
42
|
+
- [requestRuntimePermissions()](#requestruntimepermissions)
|
|
43
|
+
- [Parameters](#parameters-4)
|
|
44
|
+
- [Example usage](#example-usage-4)
|
|
45
|
+
- [isRequestingPermission()](#isrequestingpermission)
|
|
46
|
+
- [Example usage](#example-usage-5)
|
|
47
|
+
- [registerPermissionRequestCompleteHandler()](#registerpermissionrequestcompletehandler)
|
|
48
|
+
- [Parameters](#parameters-5)
|
|
49
|
+
- [Example usage](#example-usage-6)
|
|
50
|
+
- [isDataRoamingEnabled()](#isdataroamingenabled)
|
|
51
|
+
- [Parameters](#parameters-6)
|
|
52
|
+
- [Example usage](#example-usage-7)
|
|
53
|
+
- [isADBModeEnabled()](#isadbmodeenabled)
|
|
54
|
+
- [Parameters](#parameters-7)
|
|
55
|
+
- [Example usage](#example-usage-8)
|
|
56
|
+
- [isDeviceRooted()](#isdevicerooted)
|
|
57
|
+
- [Parameters](#parameters-8)
|
|
58
|
+
- [Example usage](#example-usage-9)
|
|
59
|
+
- [isBackgroundRefreshAuthorized()](#isbackgroundrefreshauthorized)
|
|
60
|
+
- [Parameters](#parameters-9)
|
|
61
|
+
- [Example usage](#example-usage-10)
|
|
62
|
+
- [getBackgroundRefreshStatus()](#getbackgroundrefreshstatus)
|
|
63
|
+
- [Parameters](#parameters-10)
|
|
64
|
+
- [Example usage](#example-usage-11)
|
|
65
|
+
- [cpuArchitecture constants](#cpuarchitecture-constants)
|
|
66
|
+
- [Android](#android-1)
|
|
67
|
+
- [iOS](#ios-1)
|
|
68
|
+
- [Example usage](#example-usage-12)
|
|
69
|
+
- [getArchitecture()](#getarchitecture)
|
|
70
|
+
- [Parameters](#parameters-11)
|
|
71
|
+
- [Example usage](#example-usage-13)
|
|
72
|
+
- [restart()](#restart)
|
|
73
|
+
- [Parameters](#parameters-12)
|
|
74
|
+
- [Example usage](#example-usage-14)
|
|
75
|
+
- [enableDebug()](#enabledebug)
|
|
76
|
+
- [Parameters](#parameters-13)
|
|
77
|
+
- [Example usage](#example-usage-15)
|
|
78
|
+
- [getCurrentBatteryLevel()](#getcurrentbatterylevel)
|
|
79
|
+
- [Parameters](#parameters-14)
|
|
80
|
+
- [Example usage](#example-usage-16)
|
|
81
|
+
- [isLowPowerModeEnabled()](#islowpowermodeenabled)
|
|
82
|
+
- [onLowPowerModeChange()](#onlowpowermodechange)
|
|
83
|
+
- [isIgnoringBatteryOptimizations()](#isignoringbatteryoptimizations)
|
|
84
|
+
- [requestIgnoreBatteryOptimizations()](#requestignorebatteryoptimizations)
|
|
85
|
+
- [isAirplaneModeEnabled()](#isairplanemodeenabled)
|
|
86
|
+
- [Parameters](#parameters-15)
|
|
87
|
+
- [Example usage](#example-usage-17)
|
|
88
|
+
- [isMobileDataEnabled()](#ismobiledataenabled)
|
|
89
|
+
- [Parameters](#parameters-16)
|
|
90
|
+
- [Example usage](#example-usage-18)
|
|
91
|
+
- [isMobileDataAuthorized()](#ismobiledataauthorized)
|
|
92
|
+
- [Parameters](#parameters-17)
|
|
93
|
+
- [Example usage](#example-usage-19)
|
|
94
|
+
- [isAccessibilityModeEnabled()](#isaccessibilitymodeenabled)
|
|
95
|
+
- [Parameters](#parameters-18)
|
|
96
|
+
- [Example usage](#example-usage-20)
|
|
97
|
+
- [isTouchExplorationEnabled()](#istouchexplorationenabled)
|
|
98
|
+
- [Parameters](#parameters-19)
|
|
99
|
+
- [Example usage](#example-usage-21)
|
|
100
|
+
- [getDeviceOSVersion()](#getdeviceosversion)
|
|
101
|
+
- [Parameters](#parameters-20)
|
|
102
|
+
- [Example usage](#example-usage-22)
|
|
103
|
+
- [getBuildOSVersion()](#getbuildosversion)
|
|
104
|
+
- [Parameters](#parameters-21)
|
|
105
|
+
- [Example usage](#example-usage-23)
|
|
106
|
+
- [isDebugBuild()](#isdebugbuild)
|
|
107
|
+
- [Parameters](#parameters-22)
|
|
108
|
+
- [Example usage](#example-usage-24)
|
|
109
|
+
- [Location module](#location-module)
|
|
110
|
+
- [locationMode constants](#locationmode-constants)
|
|
111
|
+
- [Values](#values)
|
|
112
|
+
- [Example](#example-1)
|
|
113
|
+
- [locationAuthorizationMode constants](#locationauthorizationmode-constants)
|
|
114
|
+
- [Values](#values-1)
|
|
115
|
+
- [Example](#example-2)
|
|
116
|
+
- [locationAccuracyAuthorization constants](#locationaccuracyauthorization-constants)
|
|
117
|
+
- [Values](#values-2)
|
|
118
|
+
- [isLocationAvailable()](#islocationavailable)
|
|
119
|
+
- [Parameters](#parameters-23)
|
|
120
|
+
- [Example usage](#example-usage-25)
|
|
121
|
+
- [isLocationEnabled()](#islocationenabled)
|
|
122
|
+
- [Parameters](#parameters-24)
|
|
123
|
+
- [Example usage](#example-usage-26)
|
|
124
|
+
- [isGpsLocationAvailable()](#isgpslocationavailable)
|
|
125
|
+
- [Parameters](#parameters-25)
|
|
126
|
+
- [Example usage](#example-usage-27)
|
|
127
|
+
- [isGpsLocationEnabled()](#isgpslocationenabled)
|
|
128
|
+
- [Parameters](#parameters-26)
|
|
129
|
+
- [Example usage](#example-usage-28)
|
|
130
|
+
- [isCompassAvailable()](#iscompassavailable)
|
|
131
|
+
- [Parameters](#parameters-27)
|
|
132
|
+
- [Example usage](#example-usage-29)
|
|
133
|
+
- [isNetworkLocationAvailable()](#isnetworklocationavailable)
|
|
134
|
+
- [Parameters](#parameters-28)
|
|
135
|
+
- [Example usage](#example-usage-30)
|
|
136
|
+
- [isNetworkLocationEnabled()](#isnetworklocationenabled)
|
|
137
|
+
- [Parameters](#parameters-29)
|
|
138
|
+
- [Example usage](#example-usage-31)
|
|
139
|
+
- [getLocationMode()](#getlocationmode)
|
|
140
|
+
- [Parameters](#parameters-30)
|
|
141
|
+
- [Example usage](#example-usage-32)
|
|
142
|
+
- [isLocationAuthorized()](#islocationauthorized)
|
|
143
|
+
- [Parameters](#parameters-31)
|
|
144
|
+
- [Example usage](#example-usage-33)
|
|
145
|
+
- [getLocationAuthorizationStatus()](#getlocationauthorizationstatus)
|
|
146
|
+
- [Parameters](#parameters-32)
|
|
147
|
+
- [Example iOS usage](#example-ios-usage)
|
|
148
|
+
- [Example Android usage](#example-android-usage)
|
|
149
|
+
- [getLocationAuthorizationStatuses()](#getlocationauthorizationstatuses)
|
|
150
|
+
- [Parameters](#parameters-33)
|
|
151
|
+
- [requestLocationAuthorization()](#requestlocationauthorization)
|
|
152
|
+
- [Parameters](#parameters-34)
|
|
153
|
+
- [Example usage](#example-usage-34)
|
|
154
|
+
- [registerLocationStateChangeHandler()](#registerlocationstatechangehandler)
|
|
155
|
+
- [Parameters](#parameters-35)
|
|
156
|
+
- [Example usage](#example-usage-35)
|
|
157
|
+
- [getLocationAccuracyAuthorization()](#getlocationaccuracyauthorization)
|
|
158
|
+
- [Parameters](#parameters-36)
|
|
159
|
+
- [Example usage](#example-usage-36)
|
|
160
|
+
- [requestTemporaryFullAccuracyAuthorization()](#requesttemporaryfullaccuracyauthorization)
|
|
161
|
+
- [Parameters](#parameters-37)
|
|
162
|
+
- [Example usage](#example-usage-37)
|
|
163
|
+
- [registerLocationAccuracyAuthorizationChangeHandler()](#registerlocationaccuracyauthorizationchangehandler)
|
|
164
|
+
- [Parameters](#parameters-38)
|
|
165
|
+
- [Example usage](#example-usage-38)
|
|
166
|
+
- [switchToLocationSettings()](#switchtolocationsettings)
|
|
167
|
+
- [Bluetooth module](#bluetooth-module)
|
|
168
|
+
- [bluetoothState constants](#bluetoothstate-constants)
|
|
169
|
+
- [Android](#android-2)
|
|
170
|
+
- [iOS](#ios-2)
|
|
171
|
+
- [Example](#example-3)
|
|
172
|
+
- [isBluetoothAvailable()](#isbluetoothavailable)
|
|
173
|
+
- [Parameters](#parameters-39)
|
|
174
|
+
- [Example usage](#example-usage-39)
|
|
175
|
+
- [isBluetoothEnabled()](#isbluetoothenabled)
|
|
176
|
+
- [Parameters](#parameters-40)
|
|
177
|
+
- [Example usage](#example-usage-40)
|
|
178
|
+
- [hasBluetoothSupport()](#hasbluetoothsupport)
|
|
179
|
+
- [Parameters](#parameters-41)
|
|
180
|
+
- [Example usage](#example-usage-41)
|
|
181
|
+
- [hasBluetoothLESupport()](#hasbluetoothlesupport)
|
|
182
|
+
- [Parameters](#parameters-42)
|
|
183
|
+
- [Example usage](#example-usage-42)
|
|
184
|
+
- [hasBluetoothLEPeripheralSupport()](#hasbluetoothleperipheralsupport)
|
|
185
|
+
- [Parameters](#parameters-43)
|
|
186
|
+
- [Example usage](#example-usage-43)
|
|
187
|
+
- [getBluetoothState()](#getbluetoothstate)
|
|
188
|
+
- [Parameters](#parameters-44)
|
|
189
|
+
- [Example usage](#example-usage-44)
|
|
190
|
+
- [setBluetoothState()](#setbluetoothstate)
|
|
191
|
+
- [Parameters](#parameters-45)
|
|
192
|
+
- [Example usage](#example-usage-45)
|
|
193
|
+
- [getBluetoothAuthorizationStatus()](#getbluetoothauthorizationstatus)
|
|
194
|
+
- [Parameters](#parameters-46)
|
|
195
|
+
- [Example usage](#example-usage-46)
|
|
196
|
+
- [getBluetoothAuthorizationStatuses()](#getbluetoothauthorizationstatuses)
|
|
197
|
+
- [Parameters](#parameters-47)
|
|
198
|
+
- [Example usage](#example-usage-47)
|
|
199
|
+
- [requestBluetoothAuthorization()](#requestbluetoothauthorization)
|
|
200
|
+
- [Parameters](#parameters-48)
|
|
201
|
+
- [Example usage](#example-usage-48)
|
|
202
|
+
- [registerBluetoothStateChangeHandler()](#registerbluetoothstatechangehandler)
|
|
203
|
+
- [Parameters](#parameters-49)
|
|
204
|
+
- [Example usage](#example-usage-49)
|
|
205
|
+
- [switchToBluetoothSettings()](#switchtobluetoothsettings)
|
|
206
|
+
- [WiFi module](#wifi-module)
|
|
207
|
+
- [isWifiAvailable()](#iswifiavailable)
|
|
208
|
+
- [Parameters](#parameters-50)
|
|
209
|
+
- [Example usage](#example-usage-50)
|
|
210
|
+
- [isWifiEnabled()](#iswifienabled)
|
|
211
|
+
- [Parameters](#parameters-51)
|
|
212
|
+
- [Example usage](#example-usage-51)
|
|
213
|
+
- [isLocalNetworkAuthorized()](#islocalnetworkauthorized)
|
|
214
|
+
- [Parameters](#parameters-52)
|
|
215
|
+
- [Example usage](#example-usage-52)
|
|
216
|
+
- [getLocalNetworkAuthorizationStatus()](#getlocalnetworkauthorizationstatus)
|
|
217
|
+
- [Parameters](#parameters-53)
|
|
218
|
+
- [Example usage](#example-usage-53)
|
|
219
|
+
- [requestLocalNetworkAuthorization()](#requestlocalnetworkauthorization)
|
|
220
|
+
- [Parameters](#parameters-54)
|
|
221
|
+
- [Example usage](#example-usage-54)
|
|
222
|
+
- [setWifiState()](#setwifistate)
|
|
223
|
+
- [Parameters](#parameters-55)
|
|
224
|
+
- [Example usage](#example-usage-55)
|
|
225
|
+
- [switchToWifiSettings()](#switchtowifisettings)
|
|
226
|
+
- [Camera module](#camera-module)
|
|
227
|
+
- [isCameraPresent()](#iscamerapresent)
|
|
228
|
+
- [Parameters](#parameters-56)
|
|
229
|
+
- [Example usage](#example-usage-56)
|
|
230
|
+
- [isCameraAvailable()](#iscameraavailable)
|
|
231
|
+
- [Parameters](#parameters-57)
|
|
232
|
+
- [Example usage](#example-usage-57)
|
|
233
|
+
- [isCameraAuthorized()](#iscameraauthorized)
|
|
234
|
+
- [Parameters](#parameters-58)
|
|
235
|
+
- [Example usage](#example-usage-58)
|
|
236
|
+
- [getCameraAuthorizationStatus()](#getcameraauthorizationstatus)
|
|
237
|
+
- [Parameters](#parameters-59)
|
|
238
|
+
- [Example usage](#example-usage-59)
|
|
239
|
+
- [getCameraAuthorizationStatuses()](#getcameraauthorizationstatuses)
|
|
240
|
+
- [Parameters](#parameters-60)
|
|
241
|
+
- [Example usage](#example-usage-60)
|
|
242
|
+
- [requestCameraAuthorization()](#requestcameraauthorization)
|
|
243
|
+
- [Parameters](#parameters-61)
|
|
244
|
+
- [Example usage](#example-usage-61)
|
|
245
|
+
- [isCameraRollAuthorized()](#iscamerarollauthorized)
|
|
246
|
+
- [Parameters](#parameters-62)
|
|
247
|
+
- [Example usage](#example-usage-62)
|
|
248
|
+
- [getCameraRollAuthorizationStatus()](#getcamerarollauthorizationstatus)
|
|
249
|
+
- [Parameters](#parameters-63)
|
|
250
|
+
- [Example usage](#example-usage-63)
|
|
251
|
+
- [requestCameraRollAuthorization()](#requestcamerarollauthorization)
|
|
252
|
+
- [Parameters](#parameters-64)
|
|
253
|
+
- [Example usage](#example-usage-64)
|
|
254
|
+
- [presentLimitedLibraryPicker()](#presentlimitedlibrarypicker)
|
|
255
|
+
- [Parameters](#parameters-65)
|
|
256
|
+
- [Example usage](#example-usage-65)
|
|
257
|
+
- [Notifications module](#notifications-module)
|
|
258
|
+
- [remoteNotificationType constants](#remotenotificationtype-constants)
|
|
259
|
+
- [Example](#example-4)
|
|
260
|
+
- [isRemoteNotificationsEnabled()](#isremotenotificationsenabled)
|
|
261
|
+
- [Parameters](#parameters-66)
|
|
262
|
+
- [Example usage](#example-usage-66)
|
|
263
|
+
- [isRegisteredForRemoteNotifications()](#isregisteredforremotenotifications)
|
|
264
|
+
- [Parameters](#parameters-67)
|
|
265
|
+
- [Example usage](#example-usage-67)
|
|
266
|
+
- [getRemoteNotificationTypes()](#getremotenotificationtypes)
|
|
267
|
+
- [Parameters](#parameters-68)
|
|
268
|
+
- [Example usage](#example-usage-68)
|
|
269
|
+
- [getRemoteNotificationsAuthorizationStatus()](#getremotenotificationsauthorizationstatus)
|
|
270
|
+
- [Parameters](#parameters-69)
|
|
271
|
+
- [Example usage](#example-usage-69)
|
|
272
|
+
- [requestRemoteNotificationsAuthorization()](#requestremotenotificationsauthorization)
|
|
273
|
+
- [Parameters](#parameters-70)
|
|
274
|
+
- [Example usage](#example-usage-70)
|
|
275
|
+
- [switchToNotificationSettings()](#switchtonotificationsettings)
|
|
276
|
+
- [Microphone module](#microphone-module)
|
|
277
|
+
- [isMicrophoneAuthorized()](#ismicrophoneauthorized)
|
|
278
|
+
- [Parameters](#parameters-71)
|
|
279
|
+
- [Example usage](#example-usage-71)
|
|
280
|
+
- [getMicrophoneAuthorizationStatus()](#getmicrophoneauthorizationstatus)
|
|
281
|
+
- [Parameters](#parameters-72)
|
|
282
|
+
- [Example usage](#example-usage-72)
|
|
283
|
+
- [requestMicrophoneAuthorization()](#requestmicrophoneauthorization)
|
|
284
|
+
- [Parameters](#parameters-73)
|
|
285
|
+
- [Example usage](#example-usage-73)
|
|
286
|
+
- [Contacts module](#contacts-module)
|
|
287
|
+
- [isContactsAuthorized()](#iscontactsauthorized)
|
|
288
|
+
- [Parameters](#parameters-74)
|
|
289
|
+
- [Example usage](#example-usage-74)
|
|
290
|
+
- [getContactsAuthorizationStatus()](#getcontactsauthorizationstatus)
|
|
291
|
+
- [Parameters](#parameters-75)
|
|
292
|
+
- [Example usage](#example-usage-75)
|
|
293
|
+
- [requestContactsAuthorization()](#requestcontactsauthorization)
|
|
294
|
+
- [Parameters](#parameters-76)
|
|
295
|
+
- [Example usage](#example-usage-76)
|
|
296
|
+
- [Calendar module](#calendar-module)
|
|
297
|
+
- [isCalendarAuthorized()](#iscalendarauthorized)
|
|
298
|
+
- [Parameters](#parameters-77)
|
|
299
|
+
- [Example usage](#example-usage-77)
|
|
300
|
+
- [getCalendarAuthorizationStatus()](#getcalendarauthorizationstatus)
|
|
301
|
+
- [Parameters](#parameters-78)
|
|
302
|
+
- [Example usage](#example-usage-78)
|
|
303
|
+
- [requestCalendarAuthorization()](#requestcalendarauthorization)
|
|
304
|
+
- [Parameters](#parameters-79)
|
|
305
|
+
- [Example usage](#example-usage-79)
|
|
306
|
+
- [Reminders module](#reminders-module)
|
|
307
|
+
- [isRemindersAuthorized()](#isremindersauthorized)
|
|
308
|
+
- [Parameters](#parameters-80)
|
|
309
|
+
- [Example usage](#example-usage-80)
|
|
310
|
+
- [getRemindersAuthorizationStatus()](#getremindersauthorizationstatus)
|
|
311
|
+
- [Parameters](#parameters-81)
|
|
312
|
+
- [Example usage](#example-usage-81)
|
|
313
|
+
- [requestRemindersAuthorization()](#requestremindersauthorization)
|
|
314
|
+
- [Parameters](#parameters-82)
|
|
315
|
+
- [Example usage](#example-usage-82)
|
|
316
|
+
- [Motion module](#motion-module)
|
|
317
|
+
- [motionStatus constants](#motionstatus-constants)
|
|
318
|
+
- [Example](#example-5)
|
|
319
|
+
- [isMotionAvailable()](#ismotionavailable)
|
|
320
|
+
- [Parameters](#parameters-83)
|
|
321
|
+
- [Example usage](#example-usage-83)
|
|
322
|
+
- [isMotionRequestOutcomeAvailable()](#ismotionrequestoutcomeavailable)
|
|
323
|
+
- [Parameters](#parameters-84)
|
|
324
|
+
- [Example usage](#example-usage-84)
|
|
325
|
+
- [requestMotionAuthorization()](#requestmotionauthorization)
|
|
326
|
+
- [Parameters](#parameters-85)
|
|
327
|
+
- [Example usage](#example-usage-85)
|
|
328
|
+
- [getMotionAuthorizationStatus()](#getmotionauthorizationstatus)
|
|
329
|
+
- [Parameters](#parameters-86)
|
|
330
|
+
- [Example usage](#example-usage-86)
|
|
331
|
+
- [NFC module](#nfc-module)
|
|
332
|
+
- [NFCState constants](#nfcstate-constants)
|
|
333
|
+
- [Values](#values-3)
|
|
334
|
+
- [Example](#example-6)
|
|
335
|
+
- [isNFCPresent()](#isnfcpresent)
|
|
336
|
+
- [Parameters](#parameters-87)
|
|
337
|
+
- [Example usage](#example-usage-87)
|
|
338
|
+
- [isNFCEnabled()](#isnfcenabled)
|
|
339
|
+
- [Parameters](#parameters-88)
|
|
340
|
+
- [Example usage](#example-usage-88)
|
|
341
|
+
- [isNFCAvailable()](#isnfcavailable)
|
|
342
|
+
- [Parameters](#parameters-89)
|
|
343
|
+
- [Example usage](#example-usage-89)
|
|
344
|
+
- [registerNFCStateChangeHandler()](#registernfcstatechangehandler)
|
|
345
|
+
- [Parameters](#parameters-90)
|
|
346
|
+
- [Example usage](#example-usage-90)
|
|
347
|
+
- [switchToNFCSettings()](#switchtonfcsettings)
|
|
348
|
+
- [External storage module](#external-storage-module)
|
|
349
|
+
- [isExternalStorageAuthorized()](#isexternalstorageauthorized)
|
|
350
|
+
- [Parameters](#parameters-91)
|
|
351
|
+
- [Example usage](#example-usage-91)
|
|
352
|
+
- [getExternalStorageAuthorizationStatus()](#getexternalstorageauthorizationstatus)
|
|
353
|
+
- [Parameters](#parameters-92)
|
|
354
|
+
- [Example usage](#example-usage-92)
|
|
355
|
+
- [requestExternalStorageAuthorization()](#requestexternalstorageauthorization)
|
|
356
|
+
- [Parameters](#parameters-93)
|
|
357
|
+
- [Example usage](#example-usage-93)
|
|
358
|
+
- [getExternalSdCardDetails()](#getexternalsdcarddetails)
|
|
359
|
+
- [Parameters](#parameters-94)
|
|
360
|
+
- [Example usage](#example-usage-94)
|
|
361
|
+
- [Platform Notes](#platform-notes)
|
|
362
|
+
- [Android](#android-3)
|
|
363
|
+
- [Android permissions](#android-permissions)
|
|
364
|
+
- [Android runtime permissions](#android-runtime-permissions)
|
|
365
|
+
- ["Dangerous" runtime permissions](#dangerous-runtime-permissions)
|
|
366
|
+
- [Android 11+ runtime permissions](#android-11-runtime-permissions)
|
|
367
|
+
- [Runtime permissions example project](#runtime-permissions-example-project)
|
|
368
|
+
- [Android Camera permissions](#android-camera-permissions)
|
|
369
|
+
- [Android Auto Backup](#android-auto-backup)
|
|
370
|
+
- [iOS](#ios-3)
|
|
371
|
+
- [iOS usage description messages](#ios-usage-description-messages)
|
|
372
|
+
- [Example project](#example-project)
|
|
373
|
+
- [Screenshots](#screenshots)
|
|
374
|
+
- [Android](#android-4)
|
|
375
|
+
- [iOS](#ios-4)
|
|
376
|
+
- [Release notes](#release-notes)
|
|
377
|
+
- [Credits](#credits)
|
|
378
|
+
- [License](#license)
|
|
379
|
+
|
|
380
|
+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
|
|
377
381
|
|
|
378
382
|
|
|
379
383
|
# Overview
|
|
@@ -1142,6 +1146,95 @@ The function is passed a single `string` parameter containing the error message.
|
|
|
1142
1146
|
console.log(`Current battery level is ${level}%`);
|
|
1143
1147
|
});
|
|
1144
1148
|
|
|
1149
|
+
### isLowPowerModeEnabled()
|
|
1150
|
+
|
|
1151
|
+
Platforms: Android and iOS
|
|
1152
|
+
|
|
1153
|
+
Checks if low power mode is currently enabled on the device.
|
|
1154
|
+
|
|
1155
|
+
cordova.plugins.diagnostic.isLowPowerModeEnabled(successCallback, errorCallback);
|
|
1156
|
+
|
|
1157
|
+
#### Parameters
|
|
1158
|
+
|
|
1159
|
+
- {Function} successCallback - The callback which will be called when operation is successful.
|
|
1160
|
+
The function is passed a single boolean parameter which is TRUE if low power mode is enabled.
|
|
1161
|
+
- {Function} errorCallback - The callback which will be called when operation encounters an error.
|
|
1162
|
+
The function is passed a single string parameter containing the error message.
|
|
1163
|
+
|
|
1164
|
+
#### Example usage
|
|
1165
|
+
|
|
1166
|
+
cordova.plugins.diagnostic.isLowPowerModeEnabled(function(enabled){
|
|
1167
|
+
console.log(`Low power mode is currently ${enabled ? 'enabled' : 'disabled'}`);
|
|
1168
|
+
}, function(error){
|
|
1169
|
+
console.error("The following error occurred: "+error);
|
|
1170
|
+
});
|
|
1171
|
+
|
|
1172
|
+
### onLowPowerModeChange()
|
|
1173
|
+
|
|
1174
|
+
Platforms: Android and iOS
|
|
1175
|
+
|
|
1176
|
+
Registers a callback function to be called whenever the device low power mode status changes.
|
|
1177
|
+
|
|
1178
|
+
cordova.plugins.diagnostic.onLowPowerModeChange(callback);
|
|
1179
|
+
|
|
1180
|
+
#### Parameters
|
|
1181
|
+
|
|
1182
|
+
- {Function} callback - The callback which will be called whenever low power mode changes.
|
|
1183
|
+
The function is passed a single boolean parameter which is TRUE if low power mode is enabled.
|
|
1184
|
+
|
|
1185
|
+
#### Example usage
|
|
1186
|
+
|
|
1187
|
+
cordova.plugins.diagnostic.onLowPowerModeChange(function(enabled){
|
|
1188
|
+
console.log(`Low power mode changed: ${enabled ? 'enabled' : 'disabled'}`);
|
|
1189
|
+
});
|
|
1190
|
+
|
|
1191
|
+
### isIgnoringBatteryOptimizations()
|
|
1192
|
+
|
|
1193
|
+
Platforms: Android
|
|
1194
|
+
|
|
1195
|
+
Checks if the app is currently ignoring battery optimizations.
|
|
1196
|
+
|
|
1197
|
+
cordova.plugins.diagnostic.isIgnoringBatteryOptimizations(successCallback, errorCallback);
|
|
1198
|
+
|
|
1199
|
+
#### Parameters
|
|
1200
|
+
|
|
1201
|
+
- {Function} successCallback - The callback which will be called when operation is successful.
|
|
1202
|
+
The function is passed a single boolean parameter which is TRUE if the app is ignoring battery optimizations.
|
|
1203
|
+
- {Function} errorCallback - The callback which will be called when operation encounters an error.
|
|
1204
|
+
The function is passed a single string parameter containing the error message.
|
|
1205
|
+
|
|
1206
|
+
#### Example usage
|
|
1207
|
+
|
|
1208
|
+
cordova.plugins.diagnostic.isIgnoringBatteryOptimizations(function(enabled){
|
|
1209
|
+
console.log(`Ignoring battery optimizations: ${enabled ? 'yes' : 'no'}`);
|
|
1210
|
+
}, function(error){
|
|
1211
|
+
console.error("The following error occurred: "+error);
|
|
1212
|
+
});
|
|
1213
|
+
|
|
1214
|
+
### requestIgnoreBatteryOptimizations()
|
|
1215
|
+
|
|
1216
|
+
Platforms: Android
|
|
1217
|
+
|
|
1218
|
+
Prompts the user to allow the app to ignore battery optimizations.
|
|
1219
|
+
|
|
1220
|
+
Requires permission `<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />`, which needs to be added to the app's Android manifest.
|
|
1221
|
+
|
|
1222
|
+
cordova.plugins.diagnostic.requestIgnoreBatteryOptimizations(successCallback, errorCallback);
|
|
1223
|
+
|
|
1224
|
+
#### Parameters
|
|
1225
|
+
|
|
1226
|
+
- {Function} successCallback - The callback which will be called when the system request UI is opened.
|
|
1227
|
+
- {Function} errorCallback - The callback which will be called when operation encounters an error.
|
|
1228
|
+
The function is passed a single string parameter containing the error message.
|
|
1229
|
+
|
|
1230
|
+
#### Example usage
|
|
1231
|
+
|
|
1232
|
+
cordova.plugins.diagnostic.requestIgnoreBatteryOptimizations(function(){
|
|
1233
|
+
console.log("Opened battery optimization exemption request");
|
|
1234
|
+
}, function(error){
|
|
1235
|
+
console.error("The following error occurred: "+error);
|
|
1236
|
+
});
|
|
1237
|
+
|
|
1145
1238
|
### isAirplaneModeEnabled()
|
|
1146
1239
|
|
|
1147
1240
|
Platforms: Android
|