cordova.plugins.diagnostic 6.0.4

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.
Files changed (75) hide show
  1. package/.github/FUNDING.yml +6 -0
  2. package/.github/ISSUE_TEMPLATE/bug_report.md +123 -0
  3. package/.github/ISSUE_TEMPLATE/documentation-issue.md +36 -0
  4. package/.github/ISSUE_TEMPLATE/feature_request.md +41 -0
  5. package/.github/PULL_REQUEST_TEMPLATE.md +37 -0
  6. package/.github/stale.yml +17 -0
  7. package/CHANGELOG.md +390 -0
  8. package/README.md +3709 -0
  9. package/cordova.plugins.diagnostic.d.ts +1113 -0
  10. package/package.json +54 -0
  11. package/plugin.xml +496 -0
  12. package/scripts/apply-modules.js +165 -0
  13. package/scripts/logger.js +94 -0
  14. package/src/android/Diagnostic.java +856 -0
  15. package/src/android/Diagnostic_Bluetooth.java +297 -0
  16. package/src/android/Diagnostic_Camera.java +134 -0
  17. package/src/android/Diagnostic_External_Storage.java +273 -0
  18. package/src/android/Diagnostic_Location.java +319 -0
  19. package/src/android/Diagnostic_NFC.java +270 -0
  20. package/src/android/Diagnostic_Notifications.java +157 -0
  21. package/src/android/Diagnostic_Wifi.java +155 -0
  22. package/src/ios/Diagnostic.h +56 -0
  23. package/src/ios/Diagnostic.m +282 -0
  24. package/src/ios/Diagnostic_Bluetooth.h +24 -0
  25. package/src/ios/Diagnostic_Bluetooth.m +170 -0
  26. package/src/ios/Diagnostic_Calendar.h +24 -0
  27. package/src/ios/Diagnostic_Calendar.m +94 -0
  28. package/src/ios/Diagnostic_Camera.h +27 -0
  29. package/src/ios/Diagnostic_Camera.m +194 -0
  30. package/src/ios/Diagnostic_Contacts.h +24 -0
  31. package/src/ios/Diagnostic_Contacts.m +93 -0
  32. package/src/ios/Diagnostic_Location.h +31 -0
  33. package/src/ios/Diagnostic_Location.m +284 -0
  34. package/src/ios/Diagnostic_Microphone.h +21 -0
  35. package/src/ios/Diagnostic_Microphone.m +97 -0
  36. package/src/ios/Diagnostic_Motion.h +27 -0
  37. package/src/ios/Diagnostic_Motion.m +143 -0
  38. package/src/ios/Diagnostic_Notifications.h +22 -0
  39. package/src/ios/Diagnostic_Notifications.m +235 -0
  40. package/src/ios/Diagnostic_Reminders.h +24 -0
  41. package/src/ios/Diagnostic_Reminders.m +93 -0
  42. package/src/ios/Diagnostic_Wifi.h +19 -0
  43. package/src/ios/Diagnostic_Wifi.m +108 -0
  44. package/src/windows/diagnosticProxy.bluetooth.js +23 -0
  45. package/src/windows/diagnosticProxy.camera.js +35 -0
  46. package/src/windows/diagnosticProxy.js +137 -0
  47. package/src/windows/diagnosticProxy.location.js +54 -0
  48. package/src/windows/diagnosticProxy.wifi.js +18 -0
  49. package/www/android/diagnostic.bluetooth.js +211 -0
  50. package/www/android/diagnostic.calendar.js +90 -0
  51. package/www/android/diagnostic.camera.js +203 -0
  52. package/www/android/diagnostic.contacts.js +91 -0
  53. package/www/android/diagnostic.external_storage.js +102 -0
  54. package/www/android/diagnostic.js +1309 -0
  55. package/www/android/diagnostic.location.js +282 -0
  56. package/www/android/diagnostic.microphone.js +89 -0
  57. package/www/android/diagnostic.nfc.js +127 -0
  58. package/www/android/diagnostic.notifications.js +74 -0
  59. package/www/android/diagnostic.wifi.js +90 -0
  60. package/www/ios/diagnostic.bluetooth.js +127 -0
  61. package/www/ios/diagnostic.calendar.js +97 -0
  62. package/www/ios/diagnostic.camera.js +212 -0
  63. package/www/ios/diagnostic.contacts.js +98 -0
  64. package/www/ios/diagnostic.js +990 -0
  65. package/www/ios/diagnostic.location.js +236 -0
  66. package/www/ios/diagnostic.microphone.js +99 -0
  67. package/www/ios/diagnostic.motion.js +160 -0
  68. package/www/ios/diagnostic.notifications.js +189 -0
  69. package/www/ios/diagnostic.reminders.js +97 -0
  70. package/www/ios/diagnostic.wifi.js +80 -0
  71. package/www/windows/diagnostic.bluetooth.js +51 -0
  72. package/www/windows/diagnostic.camera.js +41 -0
  73. package/www/windows/diagnostic.js +169 -0
  74. package/www/windows/diagnostic.location.js +35 -0
  75. package/www/windows/diagnostic.wifi.js +51 -0
@@ -0,0 +1,1113 @@
1
+ // Type definitions for cordova.plugins.diagnostic v4
2
+ // Project: https://github.com/dpa99c/cordova-diagnostic-plugin
3
+ // Definitions by: Dave Alden <https://github.com/dpa99c/>
4
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5
+
6
+ /// <reference types="cordova" />
7
+
8
+ /**
9
+ * Checks whether device hardware features are enabled or available to the app, e.g. camera, GPS, wifi
10
+ */
11
+ interface Diagnostic {
12
+
13
+ /**
14
+ * ANDROID ONLY
15
+ * "Dangerous" permissions that need to be requested at run-time (Android 6.0/API 23 and above)
16
+ * See http://developer.android.com/guide/topics/security/permissions.html#perm-groups
17
+ * @type {Object}
18
+ */
19
+ permission: {
20
+ "READ_CALENDAR": "READ_CALENDAR";
21
+ "WRITE_CALENDAR": "WRITE_CALENDAR";
22
+ "CAMERA": "CAMERA";
23
+ "READ_CONTACTS": "READ_CONTACTS";
24
+ "WRITE_CONTACTS": "WRITE_CONTACTS";
25
+ "GET_ACCOUNTS": "GET_ACCOUNTS";
26
+ "ACCESS_FINE_LOCATION": "ACCESS_FINE_LOCATION";
27
+ "ACCESS_COARSE_LOCATION": "ACCESS_COARSE_LOCATION";
28
+ "ACCESS_BACKGROUND_LOCATION": "ACCESS_BACKGROUND_LOCATION";
29
+ "RECORD_AUDIO": "RECORD_AUDIO";
30
+ "READ_PHONE_STATE": "READ_PHONE_STATE";
31
+ "CALL_PHONE": "CALL_PHONE";
32
+ "ADD_VOICEMAIL": "ADD_VOICEMAIL";
33
+ "USE_SIP": "USE_SIP";
34
+ "PROCESS_OUTGOING_CALLS": "PROCESS_OUTGOING_CALLS";
35
+ "READ_CALL_LOG": "READ_CALL_LOG";
36
+ "WRITE_CALL_LOG": "WRITE_CALL_LOG";
37
+ "SEND_SMS": "SEND_SMS";
38
+ "RECEIVE_SMS": "RECEIVE_SMS";
39
+ "READ_SMS": "READ_SMS";
40
+ "RECEIVE_WAP_PUSH": "RECEIVE_WAP_PUSH";
41
+ "RECEIVE_MMS": "RECEIVE_MMS";
42
+ "WRITE_EXTERNAL_STORAGE": "WRITE_EXTERNAL_STORAGE";
43
+ "READ_EXTERNAL_STORAGE": "READ_EXTERNAL_STORAGE";
44
+ "BODY_SENSORS": "BODY_SENSORS";
45
+ "ACTIVITY_RECOGNITION": "ACTIVITY_RECOGNITION";
46
+ };
47
+
48
+ /**
49
+ * ANDROID ONLY
50
+ * Permission groups indicate which associated permissions will also be requested if a given permission is requested.
51
+ * See http://developer.android.com/guide/topics/security/permissions.html#perm-groups
52
+ * @type {Object}
53
+ */
54
+ permissionGroups: {
55
+ "CALENDAR": ["READ_CALENDAR", "WRITE_CALENDAR"];
56
+ "CAMERA": ["CAMERA"];
57
+ "CONTACTS": ["READ_CONTACTS", "WRITE_CONTACTS", "GET_ACCOUNTS"];
58
+ "LOCATION": ["ACCESS_FINE_LOCATION", "ACCESS_COARSE_LOCATION"];
59
+ "MICROPHONE": ["RECORD_AUDIO"];
60
+ "PHONE": ["READ_PHONE_STATE", "CALL_PHONE", "ADD_VOICEMAIL", "USE_SIP", "PROCESS_OUTGOING_CALLS", "READ_CALL_LOG", "WRITE_CALL_LOG"];
61
+ "SENSORS": ["BODY_SENSORS"];
62
+ "SMS": ["SEND_SMS", "RECEIVE_SMS", "READ_SMS", "RECEIVE_WAP_PUSH", "RECEIVE_MMS"];
63
+ "STORAGE": ["READ_EXTERNAL_STORAGE", "WRITE_EXTERNAL_STORAGE"];
64
+ "PHYSICAL_ACTIVITY": ["ACTIVITY_RECOGNITION"];
65
+ };
66
+
67
+ /**
68
+ * ANDROID and iOS ONLY
69
+ * Constants for requesting and reporting the various permission states.
70
+ * @type {Object}
71
+ */
72
+ permissionStatus: {
73
+ // Android only
74
+ "DENIED_ONCE": "DENIED_ONCE";
75
+
76
+ // iOS only
77
+ "RESTRICTED": "restricted";
78
+
79
+ // Both iOS and Android
80
+ "GRANTED": "authorized"|"GRANTED";
81
+ "GRANTED_WHEN_IN_USE": "authorized_when_in_use";
82
+ "NOT_REQUESTED": "not_determined"|"NOT_REQUESTED";
83
+ "DENIED_ALWAYS": "denied_always"|"DENIED_ALWAYS";
84
+ };
85
+
86
+ /**
87
+ * iOS ONLY
88
+ * Constants for requesting and reporting the various motion states.
89
+ * @type {Object}
90
+ */
91
+ motionStatus: {
92
+ UNKNOWN: "unknown";
93
+ NOT_REQUESTED: "not_requested";
94
+ DENIED_ALWAYS: "denied_always";
95
+ RESTRICTED: "restricted";
96
+ GRANTED: "authorized";
97
+ NOT_AVAILABLE: "not_available";
98
+ NOT_DETERMINED: "not_determined";
99
+ };
100
+
101
+ /**
102
+ * ANDROID and iOS ONLY
103
+ * Location authorization mode
104
+ * @type {Object}
105
+ */
106
+ locationAuthorizationMode: {
107
+ "ALWAYS": "always";
108
+ "WHEN_IN_USE": "when_in_use";
109
+ };
110
+
111
+ /**
112
+ * iOS ONLY
113
+ * Location accuracy authorization
114
+ * @type {Object}
115
+ */
116
+ locationAccuracyAuthorization: {
117
+ "FULL": "full";
118
+ "REDUCED": "reduced";
119
+ };
120
+
121
+
122
+ /**
123
+ * ANDROID ONLY
124
+ * Constants for the various location modes on Android.
125
+ * @type {Object}
126
+ */
127
+ locationMode: {
128
+ "HIGH_ACCURACY": "high_accuracy";
129
+ "DEVICE_ONLY": "device_only";
130
+ "BATTERY_SAVING": "battery_saving";
131
+ "LOCATION_OFF": "location_off";
132
+ };
133
+
134
+ /**
135
+ * ANDROID and iOS ONLY
136
+ * Constants for the various Bluetooth hardware states.
137
+ * @type {Object}
138
+ */
139
+ bluetoothState: {
140
+ // iOS only
141
+ "RESETTING": "resetting";
142
+ "UNSUPPORTED": "unsupported";
143
+ "UNAUTHORIZED": "unauthorized";
144
+
145
+ // Android only
146
+ "POWERING_OFF": "powering_off";
147
+ "POWERING_ON": "powering_on";
148
+
149
+ // Both iOS and Android
150
+ "UNKNOWN": "unknown";
151
+ "POWERED_OFF": "powered_off";
152
+ "POWERED_ON": "powered_on";
153
+ };
154
+
155
+
156
+ /**
157
+ * ANDROID ONLY
158
+ * Constants for the various NFC power states.
159
+ * @type {Object}
160
+ */
161
+ NFCState: {
162
+ "UNKNOWN": "unknown";
163
+ "POWERED_OFF": "powered_off";
164
+ "POWERING_ON": "powering_on";
165
+ "POWERED_ON": "powered_on";
166
+ "POWERING_OFF": "powering_off";
167
+ };
168
+
169
+ /**
170
+ * ANDROID ONLY
171
+ * Constants for the various CPU architectures.
172
+ * @type {Object}
173
+ */
174
+ cpuArchitecture: {
175
+ // Android only
176
+ MIPS: "MIPS";
177
+ MIPS_64: "MIPS_64";
178
+
179
+ // Both iOS and Android
180
+ UNKNOWN: "unknown";
181
+ ARMv6: "ARMv6";
182
+ ARMv7: "ARMv7";
183
+ ARMv8: "ARMv8";
184
+ X86: "X86";
185
+ X86_64: "X86_64";
186
+ };
187
+
188
+ /**
189
+ * iOS ONLY
190
+ * Constants for requesting/reporting the various types of remote notification permission types on iOS devices.
191
+ * @type {Object}
192
+ */
193
+ remoteNotificationType: {
194
+ ALERT: "alert";
195
+ SOUND: "sound";
196
+ BADGE: "badge";
197
+ };
198
+
199
+ /**
200
+ * Checks if app is able to access device location.
201
+ * @param successCallback
202
+ * @param errorCallback
203
+ */
204
+ isLocationAvailable: (
205
+ successCallback: (available: boolean) => void,
206
+ errorCallback: (error: string) => void
207
+ ) => void;
208
+
209
+ /**
210
+ * Checks if Wifi is available.
211
+ * On iOS this returns true if the device is connected to a network by WiFi.
212
+ * On Android and Windows 10 Mobile this returns true if the WiFi setting is set to enabled, and is the same as isWifiEnabled()
213
+ * @param successCallback
214
+ * @param errorCallback
215
+ */
216
+ isWifiAvailable: (
217
+ successCallback: (available: boolean) => void,
218
+ errorCallback: (error: string) => void
219
+ ) => void;
220
+
221
+ /**
222
+ * Checks if camera is available.
223
+ * On Android & iOS this returns true if the device has a camera AND the application is authorized to use it.
224
+ * On Windows 10 Mobile this returns true if the device has a rear-facing camera.
225
+ * @param successCallbackOrParams
226
+ * @param errorCallback
227
+ * @param externalStorageOrParams
228
+ */
229
+ isCameraAvailable: (
230
+ successCallbackOrParams?: (available: boolean) => void|{},
231
+ errorCallback?: (error: string) => void,
232
+ externalStorageOrParams?: boolean|{}
233
+ ) => void;
234
+
235
+ /**
236
+ * Checks if Bluetooth is available to the app.
237
+ * Returns true if the device has Bluetooth capabilities AND if Bluetooth setting is switched on (same on Android, iOS and Windows 10 Mobile)
238
+ * @param successCallback
239
+ * @param errorCallback
240
+ */
241
+ isBluetoothAvailable: (
242
+ successCallback: (available: boolean) => void,
243
+ errorCallback: (error: string) => void
244
+ ) => void;
245
+
246
+ /**
247
+ * ANDROID and WINDOWS ONLY
248
+ * Displays the device location settings to allow user to enable location services/change location mode.
249
+ */
250
+ switchToLocationSettings?: () => void;
251
+
252
+ /**
253
+ * ANDROID and WINDOWS ONLY
254
+ * Displays mobile settings to allow user to enable mobile data.
255
+ */
256
+ switchToMobileDataSettings?: () => void;
257
+
258
+ /**
259
+ * ANDROID and WINDOWS ONLY
260
+ * Displays Bluetooth settings to allow user to enable Bluetooth.
261
+ */
262
+ switchToBluetoothSettings?: () => void;
263
+
264
+ /**
265
+ * ANDROID and WINDOWS ONLY
266
+ * Displays WiFi settings to allow user to enable WiFi.
267
+ */
268
+ switchToWifiSettings?: () => void;
269
+
270
+ /**
271
+ * ANDROID and WINDOWS ONLY
272
+ * Returns true if the WiFi setting is set to enabled, and is the same as isWifiAvailable()
273
+ * @param successCallback
274
+ * @param errorCallback
275
+ */
276
+ isWifiEnabled?: (
277
+ successCallback: (enabled: boolean) => void,
278
+ errorCallback: (error: string) => void
279
+ ) => void;
280
+
281
+ /**
282
+ * ANDROID and WINDOWS ONLY
283
+ * Enables/disables WiFi on the device.
284
+ * @param successCallback
285
+ * @param errorCallback
286
+ * @param state
287
+ */
288
+ setWifiState?: (
289
+ successCallback: (enabled: boolean) => void,
290
+ errorCallback: (error: string) => void,
291
+ state: boolean
292
+ ) => void;
293
+
294
+ /**
295
+ * ANDROID and WINDOWS ONLY
296
+ * Enables/disables Bluetooth on the device.
297
+ * @param successCallback
298
+ * @param errorCallback
299
+ * @param state
300
+ */
301
+ setBluetoothState?: (
302
+ successCallback: (enabled: boolean) => void,
303
+ errorCallback: (error: string) => void,
304
+ state: boolean
305
+ ) => void;
306
+
307
+ /**
308
+ * ANDROID and iOS ONLY
309
+ * Enables debug mode, which logs native plugin debug messages to the native and JS consoles.
310
+ * Debug mode is initially disabled on plugin initialisation.
311
+ */
312
+ enableDebug?: (
313
+ successCallback: () => void
314
+ ) => void;
315
+
316
+ /**
317
+ * ANDROID and iOS ONLY
318
+ * Returns true if the device setting for location is on.
319
+ * On Android this returns true if Location Mode is switched on.
320
+ * On iOS this returns true if Location Services is switched on.
321
+ * @param successCallback
322
+ * @param errorCallback
323
+ */
324
+ isLocationEnabled?: (
325
+ successCallback: (enabled: boolean) => void,
326
+ errorCallback: (error: string) => void
327
+ ) => void;
328
+
329
+ /**
330
+ * ANDROID and iOS ONLY
331
+ * Checks if the application is authorized to use location.
332
+ * @param successCallback
333
+ * @param errorCallback
334
+ */
335
+ isLocationAuthorized?: (
336
+ successCallback: (authorized: boolean) => void,
337
+ errorCallback: (error: string) => void
338
+ ) => void;
339
+
340
+ /**
341
+ * ANDROID and iOS ONLY
342
+ * Returns the location authorization status for the application.
343
+ * @param successCallback
344
+ * @param errorCallback
345
+ */
346
+ getLocationAuthorizationStatus?: (
347
+ successCallback: (status: string) => void,
348
+ errorCallback: (error: string) => void
349
+ ) => void;
350
+
351
+ /**
352
+ * ANDROID and iOS ONLY
353
+ * Requests location authorization for the application.
354
+ * @param successCallback
355
+ * @param errorCallback
356
+ * @param mode - (optional / iOS & Android >= 10) location authorization mode specified as a locationAuthorizationMode constant. If not specified, defaults to WHEN_IN_USE.
357
+ */
358
+ requestLocationAuthorization?: (
359
+ successCallback: (status: string) => void,
360
+ errorCallback: (error: string) => void,
361
+ mode?: string
362
+ ) => void;
363
+
364
+ /**
365
+ * iOS ONLY
366
+ * Returns the location accuracy authorization for the application.
367
+ * @param successCallback
368
+ * @param errorCallback
369
+ */
370
+ getLocationAccuracyAuthorization?: (
371
+ successCallback: (status: string) => void,
372
+ errorCallback: (error: string) => void
373
+ ) => void;
374
+
375
+ /**
376
+ * iOS ONLY
377
+ * Requests temporary access to full location accuracy for the application.
378
+ * @param purpose
379
+ * @param successCallback
380
+ * @param errorCallback
381
+ */
382
+ requestTemporaryFullAccuracyAuthorization?: (
383
+ purpose: string,
384
+ successCallback?: (status: string) => void,
385
+ errorCallback?: (error: string) => void
386
+ ) => void;
387
+
388
+
389
+ /**
390
+ * ANDROID and iOS ONLY
391
+ * Checks if camera hardware is present on device.
392
+ * @param successCallback
393
+ * @param errorCallback
394
+ */
395
+ isCameraPresent?: (
396
+ successCallback: (present: boolean) => void,
397
+ errorCallback: (error: string) => void
398
+ ) => void;
399
+
400
+ /**
401
+ * ANDROID and iOS ONLY
402
+ * Checks if the application is authorized to use the camera.
403
+ * @param successCallback
404
+ * @param errorCallback
405
+ * @param externalStorageOrParams
406
+ */
407
+ isCameraAuthorized?: (
408
+ successCallbackOrParams?: (authorized: boolean) => void|{},
409
+ errorCallback?: (error: string) => void,
410
+ externalStorageOrParams?: boolean|{}
411
+ ) => void;
412
+
413
+ /**
414
+ * ANDROID and iOS ONLY
415
+ * Returns the camera authorization status for the application.
416
+ * @param successCallback
417
+ * @param errorCallback
418
+ * @param externalStorageOrParams
419
+ */
420
+ getCameraAuthorizationStatus?: (
421
+ successCallbackOrParams?: (status: string) => void|{},
422
+ errorCallback?: (error: string) => void,
423
+ externalStorageOrParams?: boolean|{}
424
+ ) => void;
425
+
426
+ /**
427
+ * ANDROID and iOS ONLY
428
+ * Requests camera authorization for the application.
429
+ * @param successCallback
430
+ * @param errorCallback
431
+ * @param externalStorageOrParams
432
+ */
433
+ requestCameraAuthorization?: (
434
+ successCallbackOrParams?: (status: string) => void|{},
435
+ errorCallback?: (error: string) => void,
436
+ externalStorageOrParams?: boolean|{}
437
+ ) => void;
438
+
439
+ /**
440
+ * ANDROID and iOS ONLY
441
+ * Checks if the application is authorized to use the microphone.
442
+ * @param successCallback
443
+ * @param errorCallback
444
+ */
445
+ isMicrophoneAuthorized?: (
446
+ successCallback: (authorized: boolean) => void,
447
+ errorCallback: (error: string) => void
448
+ ) => void;
449
+
450
+ /**
451
+ * ANDROID and iOS ONLY
452
+ * Returns the microphone authorization status for the application.
453
+ * @param successCallback
454
+ * @param errorCallback
455
+ */
456
+ getMicrophoneAuthorizationStatus?: (
457
+ successCallback: (status: string) => void,
458
+ errorCallback: (error: string) => void
459
+ ) => void;
460
+
461
+ /**
462
+ * ANDROID and iOS ONLY
463
+ * Requests microphone authorization for the application.
464
+ * @param successCallback
465
+ * @param errorCallback
466
+ */
467
+ requestMicrophoneAuthorization?: (
468
+ successCallback: (status: string) => void,
469
+ errorCallback: (error: string) => void
470
+ ) => void;
471
+
472
+ /**
473
+ * ANDROID and iOS ONLY
474
+ * Checks if the application is authorized to use contacts (address book).
475
+ * @param successCallback
476
+ * @param errorCallback
477
+ */
478
+ isContactsAuthorized?: (
479
+ successCallback: (authorized: boolean) => void,
480
+ errorCallback: (error: string) => void
481
+ ) => void;
482
+
483
+ /**
484
+ * ANDROID and iOS ONLY
485
+ * Returns the contacts authorization status for the application.
486
+ * @param successCallback
487
+ * @param errorCallback
488
+ */
489
+ getContactsAuthorizationStatus?: (
490
+ successCallback: (status: string) => void,
491
+ errorCallback: (error: string) => void
492
+ ) => void;
493
+
494
+ /**
495
+ * ANDROID and iOS ONLY
496
+ * Requests contacts authorization for the application.
497
+ * @param successCallback
498
+ * @param errorCallback
499
+ */
500
+ requestContactsAuthorization?: (
501
+ successCallback: (status: string) => void,
502
+ errorCallback: (error: string) => void
503
+ ) => void;
504
+
505
+ /**
506
+ * ANDROID and iOS ONLY
507
+ * Checks if the application is authorized to use the calendar.
508
+ * @param successCallback
509
+ * @param errorCallback
510
+ */
511
+ isCalendarAuthorized?: (
512
+ successCallback: (authorized: boolean) => void,
513
+ errorCallback: (error: string) => void
514
+ ) => void;
515
+
516
+ /**
517
+ * ANDROID and iOS ONLY
518
+ * Returns the calendar authorization status for the application.
519
+ * @param successCallback
520
+ * @param errorCallback
521
+ */
522
+ getCalendarAuthorizationStatus?: (
523
+ successCallback: (status: string) => void,
524
+ errorCallback: (error: string) => void
525
+ ) => void;
526
+
527
+ /**
528
+ * ANDROID and iOS ONLY
529
+ * Requests calendar authorization for the application.
530
+ * @param successCallback
531
+ * @param errorCallback
532
+ */
533
+ requestCalendarAuthorization?: (
534
+ successCallback: (status: string) => void,
535
+ errorCallback: (error: string) => void
536
+ ) => void;
537
+
538
+ /**
539
+ * ANDROID and iOS ONLY
540
+ * Opens settings page for this app.
541
+ * On Android, this opens the "App Info" page in the Settings app.
542
+ * On iOS, this opens the app settings page in the Settings app.
543
+ */
544
+ switchToSettings?: (
545
+ successCallback: () => void,
546
+ errorCallback: (error: string) => void
547
+ ) => void;
548
+
549
+ /**
550
+ * ANDROID and iOS ONLY
551
+ * Returns the state of Bluetooth on the device.
552
+ * @param successCallback
553
+ * @param errorCallback
554
+ */
555
+ getBluetoothState?: (
556
+ successCallback: (state: string) => void,
557
+ errorCallback: (error: string) => void
558
+ ) => void;
559
+
560
+ /**
561
+ * ANDROID and iOS ONLY
562
+ * Registers a function to be called when a change in Bluetooth state occurs. Pass in a falsey value to de-register the currently registered function.
563
+ * @param successCallback
564
+ */
565
+ registerBluetoothStateChangeHandler?: (
566
+ successCallback: (state: string) => void
567
+ ) => void;
568
+
569
+ /**
570
+ * ANDROID and iOS ONLY
571
+ * Registers a function to be called when a change in Location state occurs. Pass in a falsey value to de-register the currently registered function.
572
+ * On Android, this occurs when the Location Mode is changed.
573
+ * On iOS, this occurs when location authorization status is changed. This can be triggered either by the user's response to a location permission authorization dialog, by the user turning on/off Location Services, or by the user changing the Location authorization state specifically for your app.
574
+ * @param successCallback
575
+ */
576
+ registerLocationStateChangeHandler?: (
577
+ successCallback: (state: string) => void
578
+ ) => void;
579
+
580
+ /**
581
+ * iOS ONLY
582
+ * Registers a function to be called when a change in location accuracy authorization occurs.
583
+ * @param successCallback
584
+ */
585
+ registerLocationAccuracyAuthorizationChangeHandler?: (
586
+ successCallback: (state: string) => void
587
+ ) => void;
588
+
589
+
590
+ /**
591
+ * ANDROID ONLY
592
+ * Restarts the application.
593
+ * By default, a "warm" restart will be performed in which the main Cordova activity is immediately restarted, causing the Webview instance to be recreated.
594
+ * However, if the `cold` parameter is set to true, then the application will be "cold" restarted, meaning a system exit will be performed, causing the entire application to be restarted.
595
+ * This is useful if you want to fully reset the native application state but will cause the application to briefly disappear and re-appear.
596
+ *
597
+ * Note: There is no successCallback() since if the operation is successful, the application will restart immediately before any success callback can be applied.
598
+ * @param {(error: string) => void} errorCallback
599
+ * @param {boolean} cold
600
+ */
601
+ restart?: (
602
+ errorCallback: (error: string) => void,
603
+ cold: boolean
604
+ ) => void;
605
+
606
+ /**
607
+ * ANDROID and iOS ONLY
608
+ * Returns CPU architecture of the current device.
609
+ * @param successCallback
610
+ * @param errorCallback
611
+ */
612
+ getArchitecture?: (
613
+ successCallback: (state: string) => void,
614
+ errorCallback: (error: string) => void
615
+ ) => void;
616
+
617
+ /**
618
+ * ANDROID ONLY
619
+ * Checks if high-accuracy locations are available to the app from GPS hardware.
620
+ * Returns true if Location mode is enabled and is set to "Device only" or "High accuracy" AND if the app is authorised to use location.
621
+ * @param successCallback
622
+ * @param errorCallback
623
+ */
624
+ isGpsLocationAvailable?: (
625
+ successCallback: (available: boolean) => void,
626
+ errorCallback: (error: string) => void
627
+ ) => void;
628
+
629
+ /**
630
+ * ANDROID ONLY
631
+ * Checks if the device location setting is set to return high-accuracy locations from GPS hardware.
632
+ * Returns true if Location mode is enabled and is set to either Device only or High accuracy
633
+ * @param successCallback
634
+ * @param errorCallback
635
+ */
636
+ isGpsLocationEnabled?: (
637
+ successCallback: (enabled: boolean) => void,
638
+ errorCallback: (error: string) => void
639
+ ) => void;
640
+
641
+ /**
642
+ * ANDROID ONLY
643
+ * Checks if low-accuracy locations are available to the app from network triangulation/WiFi access points.
644
+ * Returns true if Location mode is enabled and is set to "Battery saving" or "High accuracy" AND if the app is authorised to use location.
645
+ * @param successCallback
646
+ * @param errorCallback
647
+ */
648
+ isNetworkLocationAvailable?: (
649
+ successCallback: (available: boolean) => void,
650
+ errorCallback: (error: string) => void
651
+ ) => void;
652
+
653
+ /**
654
+ * ANDROID ONLY
655
+ * Checks if the device location setting is set to return high-accuracy locations from GPS hardware.
656
+ * Returns true if Location mode is enabled and is set to either Battery saving or High accuracy
657
+ * @param successCallback
658
+ * @param errorCallback
659
+ */
660
+ isNetworkLocationEnabled?: (
661
+ successCallback: (enabled: boolean) => void,
662
+ errorCallback: (error: string) => void
663
+ ) => void;
664
+
665
+ /**
666
+ * ANDROID ONLY
667
+ * Checks if the device data roaming setting is enabled.
668
+ * Returns true if data roaming is enabled.
669
+ * @param successCallback
670
+ * @param errorCallback
671
+ */
672
+ isDataRoamingEnabled?: (
673
+ successCallback: (enabled: boolean) => void,
674
+ errorCallback: (error: string) => void
675
+ ) => void;
676
+
677
+ /**
678
+ * ANDROID ONLY
679
+ * Returns the current location mode setting for the device.
680
+ * @param successCallback
681
+ * @param errorCallback
682
+ */
683
+ getLocationMode?: (
684
+ successCallback: (mode: string) => void,
685
+ errorCallback: (error: string) => void
686
+ ) => void;
687
+
688
+ /**
689
+ * ANDROID ONLY
690
+ * Returns the current authorisation status for a given permission.
691
+ * @param successCallback
692
+ * @param errorCallback
693
+ * @param permission
694
+ */
695
+ getPermissionAuthorizationStatus?: (
696
+ successCallback: (status: string) => void,
697
+ errorCallback: (error: string) => void,
698
+ permission: string
699
+ ) => void;
700
+
701
+ /**
702
+ * ANDROID ONLY
703
+ * Returns the current authorisation status for multiple permissions.
704
+ * @param successCallback
705
+ * @param errorCallback
706
+ * @param permissions
707
+ */
708
+ getPermissionsAuthorizationStatus?: (
709
+ successCallback: (status: string[]) => void,
710
+ errorCallback: (error: string) => void,
711
+ permissions: string[]
712
+ ) => void;
713
+
714
+ /**
715
+ * ANDROID ONLY
716
+ * Requests app to be granted authorisation for a runtime permission.
717
+ * @param successCallback
718
+ * @param errorCallback
719
+ * @param permission
720
+ */
721
+ requestRuntimePermission?: (
722
+ successCallback: (status: string) => void,
723
+ errorCallback: (error: string) => void,
724
+ permission: string
725
+ ) => void;
726
+
727
+ /**
728
+ * ANDROID ONLY
729
+ * Requests app to be granted authorisation for multiple runtime permissions.
730
+ * @param successCallback
731
+ * @param errorCallback
732
+ * @param permissions
733
+ */
734
+ requestRuntimePermissions?: (
735
+ successCallback: (status: string[]) => void,
736
+ errorCallback: (error: string) => void,
737
+ permissions: string[]
738
+ ) => void;
739
+
740
+ /**
741
+ * ANDROID ONLY
742
+ * Indicates if the plugin is currently requesting a runtime permission via the native API.
743
+ */
744
+ isRequestingPermission?: () => boolean;
745
+
746
+ /**
747
+ * ANDROID ONLY
748
+ * Registers a function to be called when a runtime permission request has completed. Pass in a falsey value to de-register the currently registered function.
749
+ * @param successCallback
750
+ */
751
+ registerPermissionRequestCompleteHandler?: (
752
+ successCallback: (statuses: any) => void
753
+ ) => void;
754
+
755
+ /**
756
+ * ANDROID ONLY
757
+ * Checks if the device setting for Bluetooth is switched on.
758
+ * @param successCallback
759
+ * @param errorCallback
760
+ */
761
+ isBluetoothEnabled?: (
762
+ successCallback: (enabled: boolean) => void,
763
+ errorCallback: (error: string) => void
764
+ ) => void;
765
+
766
+ /**
767
+ * ANDROID ONLY
768
+ * Checks if the device has Bluetooth capabilities.
769
+ * @param successCallback
770
+ * @param errorCallback
771
+ */
772
+ hasBluetoothSupport?: (
773
+ successCallback: (supported: boolean) => void,
774
+ errorCallback: (error: string) => void
775
+ ) => void;
776
+
777
+ /**
778
+ * ANDROID ONLY
779
+ * Checks if the device has Bluetooth Low Energy (LE) capabilities.
780
+ * @param successCallback
781
+ * @param errorCallback
782
+ */
783
+ hasBluetoothLESupport?: (
784
+ successCallback: (supported: boolean) => void,
785
+ errorCallback: (error: string) => void
786
+ ) => void;
787
+
788
+ /**
789
+ * ANDROID ONLY
790
+ * Checks if the device supports Bluetooth Low Energy (LE) Peripheral mode.
791
+ * @param successCallback
792
+ * @param errorCallback
793
+ */
794
+ hasBluetoothLEPeripheralSupport?: (
795
+ successCallback: (supported: boolean) => void,
796
+ errorCallback: (error: string) => void
797
+ ) => void;
798
+
799
+ /**
800
+ * ANDROID ONLY
801
+ * Checks if the application is authorized to use external storage.
802
+ * @param successCallback
803
+ * @param errorCallback
804
+ */
805
+ isExternalStorageAuthorized?: (
806
+ successCallback: (authorized: boolean) => void,
807
+ errorCallback: (error: string) => void
808
+ ) => void;
809
+
810
+ /**
811
+ * ANDROID ONLY
812
+ * Returns the authorisation status for runtime permission to use the external storage.
813
+ * @param successCallback
814
+ * @param errorCallback
815
+ */
816
+ getExternalStorageAuthorizationStatus?: (
817
+ successCallback: (status: string) => void,
818
+ errorCallback: (error: string) => void
819
+ ) => void;
820
+
821
+ /**
822
+ * ANDROID ONLY
823
+ * Requests authorisation for runtime permission to use the external storage.
824
+ * @param successCallback
825
+ * @param errorCallback
826
+ */
827
+ requestExternalStorageAuthorization?: (
828
+ successCallback: (status: string) => void,
829
+ errorCallback: (error: string) => void
830
+ ) => void;
831
+
832
+ /**
833
+ * ANDROID ONLY
834
+ * Returns details of external SD card(s): absolute path, is writable, free space
835
+ * @param successCallback
836
+ * @param errorCallback
837
+ */
838
+ getExternalSdCardDetails?: (
839
+ successCallback: (status: any) => void,
840
+ errorCallback: (error: string) => void
841
+ ) => void;
842
+
843
+ /**
844
+ * ANDROID ONLY
845
+ * Checks if NFC hardware is present on device.
846
+ * @param successCallback
847
+ * @param errorCallback
848
+ */
849
+ isNFCPresent?: (
850
+ successCallback: (present: boolean) => void,
851
+ errorCallback: (error: string) => void
852
+ ) => void;
853
+
854
+ /**
855
+ * ANDROID ONLY
856
+ * Checks if the device setting for NFC is switched on.
857
+ * @param successCallback
858
+ * @param errorCallback
859
+ */
860
+ isNFCEnabled?: (
861
+ successCallback: (present: boolean) => void,
862
+ errorCallback: (error: string) => void
863
+ ) => void;
864
+
865
+ /**
866
+ * ANDROID ONLY
867
+ * Checks if NFC is available to the app.
868
+ * @param successCallback
869
+ * @param errorCallback
870
+ */
871
+ isNFCAvailable?: (
872
+ successCallback: (present: boolean) => void,
873
+ errorCallback: (error: string) => void
874
+ ) => void;
875
+
876
+ /**
877
+ * ANDROID ONLY
878
+ * Registers a function to be called when a change in NFC state occurs.
879
+ * Pass in a falsey value to de-register the currently registered function.
880
+ * @param successCallback
881
+ */
882
+ registerNFCStateChangeHandler?: (
883
+ successCallback: (state: string) => void
884
+ ) => void;
885
+
886
+ /**
887
+ * iOS ONLY
888
+ * Checks if the application is authorized to use the Camera Roll in Photos app.
889
+ * @param successCallback
890
+ * @param errorCallback
891
+ */
892
+ isCameraRollAuthorized?: (
893
+ successCallback: (authorized: boolean) => void,
894
+ errorCallback: (error: string) => void
895
+ ) => void;
896
+
897
+ /**
898
+ * iOS ONLY
899
+ * Returns the authorization status for the application to use the Camera Roll in Photos app.
900
+ * @param successCallback
901
+ * @param errorCallback
902
+ */
903
+ getCameraRollAuthorizationStatus?: (
904
+ successCallback: (status: string) => void,
905
+ errorCallback: (error: string) => void
906
+ ) => void;
907
+
908
+ /**
909
+ * iOS ONLY
910
+ * Requests camera roll authorization for the application.
911
+ * @param successCallback
912
+ * @param errorCallback
913
+ */
914
+ requestCameraRollAuthorization?: (
915
+ successCallback: (status: string) => void,
916
+ errorCallback: (error: string) => void
917
+ ) => void;
918
+
919
+ /**
920
+ * ANDROID and iOS ONLY
921
+ * Checks if remote (push) notifications are enabled.
922
+ * @param successCallback
923
+ * @param errorCallback
924
+ */
925
+ isRemoteNotificationsEnabled?: (
926
+ successCallback: (enabled: boolean) => void,
927
+ errorCallback: (error: string) => void
928
+ ) => void;
929
+
930
+ /**
931
+ * ANDROID ONLY
932
+ * Checks if ADB mode(debug mode) is enabled.
933
+ * @param successCallback
934
+ * @param errorCallback
935
+ */
936
+ isADBModeEnabled?: (
937
+ successCallback: (enabled: boolean) => void,
938
+ errorCallback: (error: string) => void
939
+ ) => void;
940
+
941
+ /**
942
+ * ANDROID ONLY
943
+ * Checks if device is rooted.
944
+ * @param successCallback
945
+ * @param errorCallback
946
+ */
947
+ isDeviceRooted?: (
948
+ successCallback: (enabled: boolean) => void,
949
+ errorCallback: (error: string) => void
950
+ ) => void;
951
+
952
+ /**
953
+ * iOS ONLY
954
+ * Indicates if the app is registered for remote (push) notifications on the device.
955
+ * @param successCallback
956
+ * @param errorCallback
957
+ */
958
+ isRegisteredForRemoteNotifications?: (
959
+ successCallback: (registered: boolean) => void,
960
+ errorCallback: (error: string) => void
961
+ ) => void;
962
+
963
+ /**
964
+ * iOS ONLY
965
+ * Indicates the current setting of notification types for the app in the Settings app.
966
+ * @param successCallback
967
+ * @param errorCallback
968
+ */
969
+ getRemoteNotificationTypes?: (
970
+ successCallback: (types: any) => void,
971
+ errorCallback: (error: string) => void
972
+ ) => void;
973
+
974
+ /**
975
+ * iOS ONLY
976
+ * Returns the remote notifications authorization status for the application.
977
+ * @param successCallback
978
+ * @param errorCallback
979
+ */
980
+ getRemoteNotificationsAuthorizationStatus?: (
981
+ successCallbackOrParams?: (status: string) => void|{},
982
+ errorCallback?: (error: string) => void
983
+ ) => void;
984
+
985
+ /**
986
+ * iOS ONLY
987
+ * Requests remote notifications authorization for the application.
988
+ * @param successCallback
989
+ * @param errorCallback
990
+ * @param types
991
+ * @param omitRegistration
992
+ */
993
+ requestRemoteNotificationsAuthorization?: (
994
+ successCallbackOrParams?: (status: string) => void|{},
995
+ errorCallback?: (error: string) => void,
996
+ types?: string[],
997
+ omitRegistration?: boolean
998
+ ) => void;
999
+
1000
+ /**
1001
+ * iOS ONLY
1002
+ * Checks if the application is authorized to use reminders.
1003
+ * @param successCallback
1004
+ * @param errorCallback
1005
+ */
1006
+ isRemindersAuthorized?: (
1007
+ successCallback: (authorized: boolean) => void,
1008
+ errorCallback: (error: string) => void
1009
+ ) => void;
1010
+
1011
+ /**
1012
+ * iOS ONLY
1013
+ * Returns the reminders authorization status for the application.
1014
+ * @param successCallback
1015
+ * @param errorCallback
1016
+ */
1017
+ getRemindersAuthorizationStatus?: (
1018
+ successCallback: (status: string) => void,
1019
+ errorCallback: (error: string) => void
1020
+ ) => void;
1021
+
1022
+ /**
1023
+ * iOS ONLY
1024
+ * Requests reminders authorization for the application.
1025
+ * @param successCallback
1026
+ * @param errorCallback
1027
+ */
1028
+ requestRemindersAuthorization?: (
1029
+ successCallback: (status: string) => void,
1030
+ errorCallback: (error: string) => void
1031
+ ) => void;
1032
+
1033
+ /**
1034
+ * iOS ONLY
1035
+ * Checks if the application is authorized for background refresh.
1036
+ * @param successCallback
1037
+ * @param errorCallback
1038
+ */
1039
+ isBackgroundRefreshAuthorized?: (
1040
+ successCallback: (authorized: boolean) => void,
1041
+ errorCallback: (error: string) => void
1042
+ ) => void;
1043
+
1044
+ /**
1045
+ * iOS ONLY
1046
+ * Returns the background refresh authorization status for the application.
1047
+ * @param successCallback
1048
+ * @param errorCallback
1049
+ */
1050
+ getBackgroundRefreshStatus?: (
1051
+ successCallback: (status: string) => void,
1052
+ errorCallback: (error: string) => void
1053
+ ) => void;
1054
+
1055
+ /**
1056
+ * iOS ONLY
1057
+ * Requests Bluetooth authorization for the application.
1058
+ * @param successCallback
1059
+ * @param errorCallback
1060
+ */
1061
+ requestBluetoothAuthorization?: (
1062
+ successCallback: () => void,
1063
+ errorCallback: (error: string) => void
1064
+ ) => void;
1065
+
1066
+ /**
1067
+ * iOS ONLY
1068
+ * Checks if motion tracking is available on the current device.
1069
+ * @param successCallback
1070
+ * @param errorCallback
1071
+ */
1072
+ isMotionAvailable?: (
1073
+ successCallback: (available: boolean) => void,
1074
+ errorCallback: (error: string) => void
1075
+ ) => void;
1076
+
1077
+ /**
1078
+ * iOS ONLY
1079
+ * Checks if it's possible to determine the outcome of a motion authorization request on the current device.
1080
+ * @param successCallback
1081
+ * @param errorCallback
1082
+ */
1083
+ isMotionRequestOutcomeAvailable?: (
1084
+ successCallback: (available: boolean) => void,
1085
+ errorCallback: (error: string) => void
1086
+ ) => void;
1087
+
1088
+ /**
1089
+ * iOS ONLY
1090
+ * Requests motion authorization for the application.
1091
+ * @param successCallback
1092
+ * @param errorCallback
1093
+ */
1094
+ requestMotionAuthorization?: (
1095
+ successCallback: (status: string) => void,
1096
+ errorCallback: (error: string) => void
1097
+ ) => void;
1098
+
1099
+ /**
1100
+ * iOS ONLY
1101
+ * Checks motion authorization status for the application.
1102
+ * @param successCallback
1103
+ * @param errorCallback
1104
+ */
1105
+ getMotionAuthorizationStatus?: (
1106
+ successCallback: (status: string) => void,
1107
+ errorCallback: (error: string) => void
1108
+ ) => void;
1109
+ }
1110
+
1111
+ interface CordovaPlugins {
1112
+ diagnostic: Diagnostic
1113
+ }