cordova.plugins.diagnostic 7.1.4 → 7.2.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 CHANGED
@@ -1,5 +1,36 @@
1
1
  # CHANGELOG
2
2
 
3
+ **v7.2.0**
4
+ * (android) feat: direct getExternalSdCardDetails without permission request
5
+ * Merged from PR [#501](https://github.com/dpa99c/cordova-diagnostic-plugin/pull/501)
6
+ * (doc) Add note about reinstalling plugin after adding modules preference to config.xml
7
+ * (doc) Clarify functionality of `enableDebug()` method
8
+ * Merged from PR [#522](https://github.com/dpa99c/cordova-diagnostic-plugin/pull/522)
9
+ * (ios) Add conditions to not use CTCellularData on Mac Catalyst.
10
+ * Merged from PR [#521](https://github.com/dpa99c/cordova-diagnostic-plugin/pull/521)
11
+ * Resolves [#520](https://github.com/dpa99c/cordova-diagnostic-plugin/issues/520)
12
+ * (ios) feat: add switchToNotificationSettings function for iOS platform
13
+ * Merged from PR [#517](https://github.com/dpa99c/cordova-diagnostic-plugin/pull/517)
14
+ * (ios) feat: add Resource Bundle to provide the Privacy Manifest
15
+ * Merged from PR [#516](https://github.com/dpa99c/cordova-diagnostic-plugin/pull/516)
16
+ * (android) fix: Bump WRITE_EXTERNAL_STORAGE to 32 for camera
17
+ * Merged from PR [#510](https://github.com/dpa99c/cordova-diagnostic-plugin/pull/510)
18
+ * Resolves [#518](https://github.com/dpa99c/cordova-diagnostic-plugin/issues/518)
19
+ * (doc) fix: recommend use of `<edit-config>` instead of `<config-file>`
20
+ * Merged from PR [#505](https://github.com/dpa99c/cordova-diagnostic-plugin/pull/505)
21
+ * (android) fix: remove unused imports
22
+ * Merged from PR [#504](https://github.com/dpa99c/cordova-diagnostic-plugin/pull/504)
23
+ * (doc) correct example log for Ephemeral permission granted
24
+ * Merged from PR [#503](https://github.com/dpa99c/cordova-diagnostic-plugin/pull/503)
25
+ * (android) fix: replace deprecated StatFs functions
26
+ * Merged from PR [#502](https://github.com/dpa99c/cordova-diagnostic-plugin/pull/502)
27
+ * (android) improve camera authorisation handling and support new behaviour in API 34 / Android 14
28
+ * Add `getCameraAuthorizationStatuses()` to return the individual statuses of requested permissions related to camera
29
+ * Change `getCameraAuthorizationStatus()` to natively derive the single combined status result based upon build SDK version and requested permission statuses
30
+ * Return a `LIMITED` status on Android 14 if user selects limited access to photo library (return `GRANTED` if user selects to allow access to all)
31
+ * Resolves [#519](https://github.com/dpa99c/cordova-diagnostic-plugin/issues/519)
32
+
33
+
3
34
  **v7.1.4**
4
35
  * (android) bugfix: decide if a permission is implicitly granted by checking if the device runtime is less than, but the build SDK used for the app is greater is or equal than, the SDK version in which the permission was added.
5
36
  * Resolves [#508](https://github.com/dpa99c/cordova-diagnostic-plugin/issues/508)
package/README.md CHANGED
@@ -2,155 +2,158 @@ Cordova diagnostic plugin [![Latest Stable Version](https://img.shields.io/npm/v
2
2
  =========================
3
3
 
4
4
  <!-- doctoc README.md --maxlevel=3 -->
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
- - [switchToWirelessSettings()](#switchtowirelesssettings)
26
- - [switchToMobileDataSettings()](#switchtomobiledatasettings)
27
- - [permissionStatus constants](#permissionstatus-constants)
28
- - [getPermissionAuthorizationStatus()](#getpermissionauthorizationstatus)
29
- - [getPermissionsAuthorizationStatus()](#getpermissionsauthorizationstatus)
30
- - [requestRuntimePermission()](#requestruntimepermission)
31
- - [requestRuntimePermissions()](#requestruntimepermissions)
32
- - [isRequestingPermission()](#isrequestingpermission)
33
- - [registerPermissionRequestCompleteHandler()](#registerpermissionrequestcompletehandler)
34
- - [isDataRoamingEnabled()](#isdataroamingenabled)
35
- - [isADBModeEnabled()](#isadbmodeenabled)
36
- - [isDeviceRooted()](#isdevicerooted)
37
- - [isBackgroundRefreshAuthorized()](#isbackgroundrefreshauthorized)
38
- - [getBackgroundRefreshStatus()](#getbackgroundrefreshstatus)
39
- - [cpuArchitecture constants](#cpuarchitecture-constants)
40
- - [getArchitecture()](#getarchitecture)
41
- - [restart()](#restart)
42
- - [enableDebug()](#enabledebug)
43
- - [getCurrentBatteryLevel()](#getcurrentbatterylevel)
44
- - [isAirplaneModeEnabled()](#isairplanemodeenabled)
45
- - [isMobileDataEnabled()](#ismobiledataenabled)
46
- - [getDeviceOSVersion()](#getdeviceosversion)
47
- - [getBuildOSVersion()](#getbuildosversion)
48
- - [Location module](#location-module)
49
- - [locationMode constants](#locationmode-constants)
50
- - [locationAuthorizationMode constants](#locationauthorizationmode-constants)
51
- - [locationAccuracyAuthorization constants](#locationaccuracyauthorization-constants)
52
- - [isLocationAvailable()](#islocationavailable)
53
- - [isLocationEnabled()](#islocationenabled)
54
- - [isGpsLocationAvailable()](#isgpslocationavailable)
55
- - [isGpsLocationEnabled()](#isgpslocationenabled)
56
- - [isNetworkLocationAvailable()](#isnetworklocationavailable)
57
- - [isNetworkLocationEnabled()](#isnetworklocationenabled)
58
- - [getLocationMode()](#getlocationmode)
59
- - [isLocationAuthorized()](#islocationauthorized)
60
- - [getLocationAuthorizationStatus()](#getlocationauthorizationstatus)
61
- - [getLocationAuthorizationStatuses()](#getlocationauthorizationstatuses)
62
- - [requestLocationAuthorization()](#requestlocationauthorization)
63
- - [registerLocationStateChangeHandler()](#registerlocationstatechangehandler)
64
- - [getLocationAccuracyAuthorization()](#getlocationaccuracyauthorization)
65
- - [requestTemporaryFullAccuracyAuthorization()](#requesttemporaryfullaccuracyauthorization)
66
- - [registerLocationAccuracyAuthorizationChangeHandler()](#registerlocationaccuracyauthorizationchangehandler)
67
- - [switchToLocationSettings()](#switchtolocationsettings)
68
- - [Bluetooth module](#bluetooth-module)
69
- - [bluetoothState constants](#bluetoothstate-constants)
70
- - [isBluetoothAvailable()](#isbluetoothavailable)
71
- - [isBluetoothEnabled()](#isbluetoothenabled)
72
- - [hasBluetoothSupport()](#hasbluetoothsupport)
73
- - [hasBluetoothLESupport()](#hasbluetoothlesupport)
74
- - [hasBluetoothLEPeripheralSupport()](#hasbluetoothleperipheralsupport)
75
- - [getBluetoothState()](#getbluetoothstate)
76
- - [setBluetoothState()](#setbluetoothstate)
77
- - [getBluetoothAuthorizationStatus()](#getbluetoothauthorizationstatus)
78
- - [getBluetoothAuthorizationStatuses()](#getbluetoothauthorizationstatuses)
79
- - [requestBluetoothAuthorization()](#requestbluetoothauthorization)
80
- - [registerBluetoothStateChangeHandler()](#registerbluetoothstatechangehandler)
81
- - [switchToBluetoothSettings()](#switchtobluetoothsettings)
82
- - [WiFi module](#wifi-module)
83
- - [isWifiAvailable()](#iswifiavailable)
84
- - [isWifiEnabled()](#iswifienabled)
85
- - [setWifiState()](#setwifistate)
86
- - [switchToWifiSettings()](#switchtowifisettings)
87
- - [Camera module](#camera-module)
88
- - [isCameraPresent()](#iscamerapresent)
89
- - [isCameraAvailable()](#iscameraavailable)
90
- - [isCameraAuthorized()](#iscameraauthorized)
91
- - [getCameraAuthorizationStatus()](#getcameraauthorizationstatus)
92
- - [requestCameraAuthorization()](#requestcameraauthorization)
93
- - [isCameraRollAuthorized()](#iscamerarollauthorized)
94
- - [getCameraRollAuthorizationStatus()](#getcamerarollauthorizationstatus)
95
- - [requestCameraRollAuthorization()](#requestcamerarollauthorization)
96
- - [presentLimitedLibraryPicker()](#presentlimitedlibrarypicker)
97
- - [Notifications module](#notifications-module)
98
- - [remoteNotificationType constants](#remotenotificationtype-constants)
99
- - [isRemoteNotificationsEnabled()](#isremotenotificationsenabled)
100
- - [isRegisteredForRemoteNotifications()](#isregisteredforremotenotifications)
101
- - [getRemoteNotificationTypes()](#getremotenotificationtypes)
102
- - [getRemoteNotificationsAuthorizationStatus()](#getremotenotificationsauthorizationstatus)
103
- - [requestRemoteNotificationsAuthorization()](#requestremotenotificationsauthorization)
104
- - [switchToNotificationSettings()](#switchtonotificationsettings)
105
- - [Microphone module](#microphone-module)
106
- - [isMicrophoneAuthorized()](#ismicrophoneauthorized)
107
- - [getMicrophoneAuthorizationStatus()](#getmicrophoneauthorizationstatus)
108
- - [requestMicrophoneAuthorization()](#requestmicrophoneauthorization)
109
- - [Contacts module](#contacts-module)
110
- - [isContactsAuthorized()](#iscontactsauthorized)
111
- - [getContactsAuthorizationStatus()](#getcontactsauthorizationstatus)
112
- - [requestContactsAuthorization()](#requestcontactsauthorization)
113
- - [Calendar module](#calendar-module)
114
- - [isCalendarAuthorized()](#iscalendarauthorized)
115
- - [getCalendarAuthorizationStatus()](#getcalendarauthorizationstatus)
116
- - [requestCalendarAuthorization()](#requestcalendarauthorization)
117
- - [Reminders module](#reminders-module)
118
- - [isRemindersAuthorized()](#isremindersauthorized)
119
- - [getRemindersAuthorizationStatus()](#getremindersauthorizationstatus)
120
- - [requestRemindersAuthorization()](#requestremindersauthorization)
121
- - [Motion module](#motion-module)
122
- - [motionStatus constants](#motionstatus-constants)
123
- - [isMotionAvailable()](#ismotionavailable)
124
- - [isMotionRequestOutcomeAvailable()](#ismotionrequestoutcomeavailable)
125
- - [requestMotionAuthorization()](#requestmotionauthorization)
126
- - [getMotionAuthorizationStatus()](#getmotionauthorizationstatus)
127
- - [NFC module](#nfc-module)
128
- - [NFCState constants](#nfcstate-constants)
129
- - [isNFCPresent()](#isnfcpresent)
130
- - [isNFCEnabled()](#isnfcenabled)
131
- - [isNFCAvailable()](#isnfcavailable)
132
- - [registerNFCStateChangeHandler()](#registernfcstatechangehandler)
133
- - [switchToNFCSettings()](#switchtonfcsettings)
134
- - [External storage module](#external-storage-module)
135
- - [isExternalStorageAuthorized()](#isexternalstorageauthorized)
136
- - [getExternalStorageAuthorizationStatus()](#getexternalstorageauthorizationstatus)
137
- - [requestExternalStorageAuthorization()](#requestexternalstorageauthorization)
138
- - [getExternalSdCardDetails()](#getexternalsdcarddetails)
139
- - [Platform Notes](#platform-notes)
140
- - [Android](#android)
141
- - [Android permissions](#android-permissions)
142
- - [Android Auto Backup](#android-auto-backup)
143
- - [iOS](#ios)
144
- - [iOS usage description messages](#ios-usage-description-messages)
145
- - [Example project](#example-project)
146
- - [Screenshots](#screenshots)
147
- - [Android](#android-1)
148
- - [iOS](#ios-1)
149
- - [Release notes](#release-notes)
150
- - [Credits](#credits)
151
- - [License](#license)
152
-
153
- <!-- END doctoc generated TOC please keep comment here to allow auto update -->
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
+ - [switchToWirelessSettings()](#switchtowirelesssettings)
26
+ - [switchToMobileDataSettings()](#switchtomobiledatasettings)
27
+ - [permissionStatus constants](#permissionstatus-constants)
28
+ - [getPermissionAuthorizationStatus()](#getpermissionauthorizationstatus)
29
+ - [getPermissionsAuthorizationStatus()](#getpermissionsauthorizationstatus)
30
+ - [requestRuntimePermission()](#requestruntimepermission)
31
+ - [requestRuntimePermissions()](#requestruntimepermissions)
32
+ - [isRequestingPermission()](#isrequestingpermission)
33
+ - [registerPermissionRequestCompleteHandler()](#registerpermissionrequestcompletehandler)
34
+ - [isDataRoamingEnabled()](#isdataroamingenabled)
35
+ - [isADBModeEnabled()](#isadbmodeenabled)
36
+ - [isDeviceRooted()](#isdevicerooted)
37
+ - [isBackgroundRefreshAuthorized()](#isbackgroundrefreshauthorized)
38
+ - [getBackgroundRefreshStatus()](#getbackgroundrefreshstatus)
39
+ - [cpuArchitecture constants](#cpuarchitecture-constants)
40
+ - [getArchitecture()](#getarchitecture)
41
+ - [restart()](#restart)
42
+ - [enableDebug()](#enabledebug)
43
+ - [getCurrentBatteryLevel()](#getcurrentbatterylevel)
44
+ - [isAirplaneModeEnabled()](#isairplanemodeenabled)
45
+ - [isMobileDataEnabled()](#ismobiledataenabled)
46
+ - [isAccessibilityModeEnabled()](#isaccessibilitymodeenabled)
47
+ - [isTouchExplorationEnabled()](#istouchexplorationenabled)
48
+ - [getDeviceOSVersion()](#getdeviceosversion)
49
+ - [getBuildOSVersion()](#getbuildosversion)
50
+ - [Location module](#location-module)
51
+ - [locationMode constants](#locationmode-constants)
52
+ - [locationAuthorizationMode constants](#locationauthorizationmode-constants)
53
+ - [locationAccuracyAuthorization constants](#locationaccuracyauthorization-constants)
54
+ - [isLocationAvailable()](#islocationavailable)
55
+ - [isLocationEnabled()](#islocationenabled)
56
+ - [isGpsLocationAvailable()](#isgpslocationavailable)
57
+ - [isGpsLocationEnabled()](#isgpslocationenabled)
58
+ - [isNetworkLocationAvailable()](#isnetworklocationavailable)
59
+ - [isNetworkLocationEnabled()](#isnetworklocationenabled)
60
+ - [getLocationMode()](#getlocationmode)
61
+ - [isLocationAuthorized()](#islocationauthorized)
62
+ - [getLocationAuthorizationStatus()](#getlocationauthorizationstatus)
63
+ - [getLocationAuthorizationStatuses()](#getlocationauthorizationstatuses)
64
+ - [requestLocationAuthorization()](#requestlocationauthorization)
65
+ - [registerLocationStateChangeHandler()](#registerlocationstatechangehandler)
66
+ - [getLocationAccuracyAuthorization()](#getlocationaccuracyauthorization)
67
+ - [requestTemporaryFullAccuracyAuthorization()](#requesttemporaryfullaccuracyauthorization)
68
+ - [registerLocationAccuracyAuthorizationChangeHandler()](#registerlocationaccuracyauthorizationchangehandler)
69
+ - [switchToLocationSettings()](#switchtolocationsettings)
70
+ - [Bluetooth module](#bluetooth-module)
71
+ - [bluetoothState constants](#bluetoothstate-constants)
72
+ - [isBluetoothAvailable()](#isbluetoothavailable)
73
+ - [isBluetoothEnabled()](#isbluetoothenabled)
74
+ - [hasBluetoothSupport()](#hasbluetoothsupport)
75
+ - [hasBluetoothLESupport()](#hasbluetoothlesupport)
76
+ - [hasBluetoothLEPeripheralSupport()](#hasbluetoothleperipheralsupport)
77
+ - [getBluetoothState()](#getbluetoothstate)
78
+ - [setBluetoothState()](#setbluetoothstate)
79
+ - [getBluetoothAuthorizationStatus()](#getbluetoothauthorizationstatus)
80
+ - [getBluetoothAuthorizationStatuses()](#getbluetoothauthorizationstatuses)
81
+ - [requestBluetoothAuthorization()](#requestbluetoothauthorization)
82
+ - [registerBluetoothStateChangeHandler()](#registerbluetoothstatechangehandler)
83
+ - [switchToBluetoothSettings()](#switchtobluetoothsettings)
84
+ - [WiFi module](#wifi-module)
85
+ - [isWifiAvailable()](#iswifiavailable)
86
+ - [isWifiEnabled()](#iswifienabled)
87
+ - [setWifiState()](#setwifistate)
88
+ - [switchToWifiSettings()](#switchtowifisettings)
89
+ - [Camera module](#camera-module)
90
+ - [isCameraPresent()](#iscamerapresent)
91
+ - [isCameraAvailable()](#iscameraavailable)
92
+ - [isCameraAuthorized()](#iscameraauthorized)
93
+ - [getCameraAuthorizationStatus()](#getcameraauthorizationstatus)
94
+ - [getCameraAuthorizationStatuses()](#getcameraauthorizationstatuses)
95
+ - [requestCameraAuthorization()](#requestcameraauthorization)
96
+ - [isCameraRollAuthorized()](#iscamerarollauthorized)
97
+ - [getCameraRollAuthorizationStatus()](#getcamerarollauthorizationstatus)
98
+ - [requestCameraRollAuthorization()](#requestcamerarollauthorization)
99
+ - [presentLimitedLibraryPicker()](#presentlimitedlibrarypicker)
100
+ - [Notifications module](#notifications-module)
101
+ - [remoteNotificationType constants](#remotenotificationtype-constants)
102
+ - [isRemoteNotificationsEnabled()](#isremotenotificationsenabled)
103
+ - [isRegisteredForRemoteNotifications()](#isregisteredforremotenotifications)
104
+ - [getRemoteNotificationTypes()](#getremotenotificationtypes)
105
+ - [getRemoteNotificationsAuthorizationStatus()](#getremotenotificationsauthorizationstatus)
106
+ - [requestRemoteNotificationsAuthorization()](#requestremotenotificationsauthorization)
107
+ - [switchToNotificationSettings()](#switchtonotificationsettings)
108
+ - [Microphone module](#microphone-module)
109
+ - [isMicrophoneAuthorized()](#ismicrophoneauthorized)
110
+ - [getMicrophoneAuthorizationStatus()](#getmicrophoneauthorizationstatus)
111
+ - [requestMicrophoneAuthorization()](#requestmicrophoneauthorization)
112
+ - [Contacts module](#contacts-module)
113
+ - [isContactsAuthorized()](#iscontactsauthorized)
114
+ - [getContactsAuthorizationStatus()](#getcontactsauthorizationstatus)
115
+ - [requestContactsAuthorization()](#requestcontactsauthorization)
116
+ - [Calendar module](#calendar-module)
117
+ - [isCalendarAuthorized()](#iscalendarauthorized)
118
+ - [getCalendarAuthorizationStatus()](#getcalendarauthorizationstatus)
119
+ - [requestCalendarAuthorization()](#requestcalendarauthorization)
120
+ - [Reminders module](#reminders-module)
121
+ - [isRemindersAuthorized()](#isremindersauthorized)
122
+ - [getRemindersAuthorizationStatus()](#getremindersauthorizationstatus)
123
+ - [requestRemindersAuthorization()](#requestremindersauthorization)
124
+ - [Motion module](#motion-module)
125
+ - [motionStatus constants](#motionstatus-constants)
126
+ - [isMotionAvailable()](#ismotionavailable)
127
+ - [isMotionRequestOutcomeAvailable()](#ismotionrequestoutcomeavailable)
128
+ - [requestMotionAuthorization()](#requestmotionauthorization)
129
+ - [getMotionAuthorizationStatus()](#getmotionauthorizationstatus)
130
+ - [NFC module](#nfc-module)
131
+ - [NFCState constants](#nfcstate-constants)
132
+ - [isNFCPresent()](#isnfcpresent)
133
+ - [isNFCEnabled()](#isnfcenabled)
134
+ - [isNFCAvailable()](#isnfcavailable)
135
+ - [registerNFCStateChangeHandler()](#registernfcstatechangehandler)
136
+ - [switchToNFCSettings()](#switchtonfcsettings)
137
+ - [External storage module](#external-storage-module)
138
+ - [isExternalStorageAuthorized()](#isexternalstorageauthorized)
139
+ - [getExternalStorageAuthorizationStatus()](#getexternalstorageauthorizationstatus)
140
+ - [requestExternalStorageAuthorization()](#requestexternalstorageauthorization)
141
+ - [getExternalSdCardDetails()](#getexternalsdcarddetails)
142
+ - [Platform Notes](#platform-notes)
143
+ - [Android](#android)
144
+ - [Android permissions](#android-permissions)
145
+ - [Android Auto Backup](#android-auto-backup)
146
+ - [iOS](#ios)
147
+ - [iOS usage description messages](#ios-usage-description-messages)
148
+ - [Example project](#example-project)
149
+ - [Screenshots](#screenshots)
150
+ - [Android](#android-1)
151
+ - [iOS](#ios-1)
152
+ - [Release notes](#release-notes)
153
+ - [Credits](#credits)
154
+ - [License](#license)
155
+
156
+ <!-- END doctoc generated TOC please keep comment here to allow auto update -->
154
157
 
155
158
 
156
159
  # Overview
@@ -235,6 +238,11 @@ To install only the core module and no optional modules, leave the preference va
235
238
 
236
239
  <preference name="cordova.plugins.diagnostic.modules" value="" />
237
240
 
241
+ **IMPORTANT:** After adding the preference to your `config.xml`, you'll need to uninstall then re-install the plugin to your project to apply the changes:
242
+ ```
243
+ cordova plugin rm cordova.plugins.diagnostic --nosave && cordova plugin add cordova.plugins.diagnostic --nosave
244
+ ```
245
+
238
246
  ### Available modules
239
247
 
240
248
  The following optional modules are currently supported by the plugin:
@@ -870,7 +878,7 @@ The function is passed a single string parameter containing the error message.
870
878
 
871
879
  Platforms: Android and iOS
872
880
 
873
- Enables debug mode, which logs native debug messages to the native and JS consoles.
881
+ Enables the plugin's debug mode, which logs native debug messages related to anything done with the plugin to the native and JS consoles.
874
882
  - For Android, log messages will appear in the native logcat output and in the JS console if Chrome Developer Tools is connected to the app Webview.
875
883
  - For iOS, log messages will appear in the native Xcode console output and in the JS console if Safari Web Inspector is connected to the app Webview.
876
884
  - Debug mode is initially disabled on plugin initialisation.
@@ -962,6 +970,49 @@ The function is passed a single string parameter containing the error message.
962
970
  console.log(`Mobile data is currently ${enabled ? 'enabled' : 'disabled'}%`);
963
971
  });
964
972
 
973
+ ### isAccessibilityModeEnabled()
974
+
975
+ Platforms: Android and iOS
976
+
977
+ Checks if Accessibility Mode (Talkback on Android, VoiceOver on iOS) is currently enabled on the device.
978
+
979
+ cordova.plugins.diagnostic.isAccessibilityModeEnabled(successCallback, errorCallback);
980
+
981
+ #### Parameters
982
+
983
+ - {Function} successCallback - The callback which will be called when the operation is successful.
984
+ This callback function is passed a single boolean parameter which is TRUE if accessibility mode is enabled.
985
+ - {Function} errorCallback - The callback which will be called when the operation encounters an error.
986
+ This callback function is passed a single string parameter containing the error message.
987
+
988
+ #### Example usage
989
+
990
+ cordova.plugins.diagnostic.isAccessibilityModeEnabled(function(enabled){
991
+ console.log(`Accessibility Mode is currently ${enabled ? 'enabled' : 'disabled'}%`);
992
+ });
993
+
994
+
995
+ ### isTouchExplorationEnabled()
996
+
997
+ Platforms: Android
998
+
999
+ Checks if touch exploration (in accessibility mode) is currently enabled on the device.
1000
+
1001
+ cordova.plugins.diagnostic.isTouchExplorationEnabled(successCallback, errorCallback);
1002
+
1003
+ #### Parameters
1004
+
1005
+ - {Function} successCallback - The callback which will be called when the operation is successful.
1006
+ This callback function is passed a single boolean parameter which is TRUE if touch exploration (in accessibility mode) is enabled.
1007
+ - {Function} errorCallback - The callback which will be called when the operation encounters an error.
1008
+ This callback function is passed a single string parameter containing the error message.
1009
+
1010
+ #### Example usage
1011
+
1012
+ cordova.plugins.diagnostic.isTouchExplorationEnabled(function(enabled){
1013
+ console.log(`touch exploration is currently ${enabled ? 'enabled' : 'disabled'}%`);
1014
+ });
1015
+
965
1016
 
966
1017
  ### getDeviceOSVersion()
967
1018
 
@@ -1594,11 +1645,11 @@ Requests temporary access to full location accuracy for the application on iOS 1
1594
1645
  - By default on iOS 14+, when a user grants location permission, the app can only receive reduced accuracy locations.
1595
1646
  - If your app requires full (high-accuracy GPS) locations (e.g. a SatNav app), you need to call this method.
1596
1647
  - You must specify a purpose corresponds to a key in the `NSLocationTemporaryUsageDescriptionDictionary` entry in your app's `*-Info.plist` containing a message explaining the user why your app needs their exact location.
1597
- You'll need to add this entry using a `<config-file>` block in your `config.xml`, e.g.:
1648
+ You'll need to add this entry using a `<config-file>` or `<edit-config>` block in your `config.xml`, e.g.:
1598
1649
 
1599
1650
 
1600
1651
  <platform name="ios">
1601
- <config-file platform="ios" target="*-Info.plist" parent="NSLocationTemporaryUsageDescriptionDictionary">
1652
+ <config-file target="*-Info.plist" parent="NSLocationTemporaryUsageDescriptionDictionary">
1602
1653
  <dict>
1603
1654
  <key>navigation</key>
1604
1655
  <string>This app requires access to your exact location in order to provide SatNav route navigation.</string>
@@ -2191,7 +2242,9 @@ Platforms: Android & iOS
2191
2242
  Checks if camera is available.
2192
2243
 
2193
2244
  Notes:
2194
- - On Android & iOS this returns true if the device has a camera AND the application is authorized to use it.
2245
+ - On Android this returns true if the device has a camera.
2246
+ - On iOS this returns true if both the device has a camera AND the application is authorized to use it.
2247
+ - On Windows 10 Mobile this returns true if both the device has a rear-facing camera AND the application is authorized to use it.
2195
2248
 
2196
2249
  Notes for Android:
2197
2250
  - By default this also checks run-time storage permissions in addition to `CAMERA` permission because [cordova-plugin-camera](https://github.com/apache/cordova-plugin-camera) requires both of these permission sets.
@@ -2257,7 +2310,7 @@ The function is passed a single string parameter containing the error message.
2257
2310
 
2258
2311
  Platforms: Android and iOS
2259
2312
 
2260
- Returns the camera authorization status for the application.
2313
+ Returns the combined camera authorization status for the application based on the relevant permissions.
2261
2314
 
2262
2315
  Notes for Android:
2263
2316
  - This is intended for Android 6 / API 23 and above. Calling on Android 5.1 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
@@ -2289,6 +2342,42 @@ The function is passed a single string parameter containing the error message.
2289
2342
  }, false
2290
2343
  );
2291
2344
 
2345
+ ### getCameraAuthorizationStatuses()
2346
+
2347
+ Platforms: Android
2348
+
2349
+ Returns the individual camera authorization statuses for each of the relevant permissions.
2350
+
2351
+ Notes for Android:
2352
+ - This is intended for Android 6 / API 23 and above. Calling on Android 5.1 / API 22 and below will always return GRANTED status as permissions are already granted at installation time.
2353
+ - By default this also checks run-time storage permissions in addition to `CAMERA` permission because [cordova-plugin-camera](https://github.com/apache/cordova-plugin-camera) requires both of these permission sets.
2354
+ - On Android 13+, storage permissions are `READ_MEDIA_IMAGES` and `READ_MEDIA_VIDEO`. On Android 12 and below, storage permissions are `READ_EXTERNAL_STORAGE` and `WRITE_EXTERNAL_STORAGE`.
2355
+
2356
+ ```
2357
+ cordova.plugins.diagnostic.getCameraAuthorizationStatuses(successCallback, errorCallback, storage)
2358
+ ```
2359
+
2360
+ #### Parameters
2361
+ - {Object} params - (optional) parameters:
2362
+ - {Function} successCallback - The callback which will be called when operation is successful.
2363
+ The function is passed a single object parameter where each key indicates the permission name and the value indicates the authorization status as a [permissionStatus constant](#permissionstatus-constants).
2364
+ - {Function} errorCallback - The callback which will be called when operation encounters an error.
2365
+ The function is passed a single string parameter containing the error message.
2366
+ - {Boolean} storage - (Android only) If true, requests storage permissions in addition to `CAMERA` run-time permission. Defaults to true.
2367
+
2368
+
2369
+ #### Example usage
2370
+
2371
+ cordova.plugins.diagnostic.getCameraAuthorizationStatuses(
2372
+ function(statuses){
2373
+ for(var permission in statuses){
2374
+ console.log(permission + " permission is: " + statuses[permission]));
2375
+ }
2376
+ }, function(error){
2377
+ console.error("The following error occurred: "+error);
2378
+ }, false
2379
+ );
2380
+
2292
2381
  ### requestCameraAuthorization()
2293
2382
 
2294
2383
  Platforms: Android and iOS
@@ -2457,7 +2546,7 @@ Platforms: iOS
2457
2546
  - Can only be used if the automatic prompt to select limited library is disabled in the app's `Info.plist` by adding the following section to `<platform name="ios">` in the app's `config.xml`:
2458
2547
 
2459
2548
  ```xml
2460
- <config-file parent="PHPhotoLibraryPreventAutomaticLimitedAccessAlert" platform="ios" target="*-Info.plist">
2549
+ <config-file target="*-Info.plist" parent="PHPhotoLibraryPreventAutomaticLimitedAccessAlert">
2461
2550
  <true/>
2462
2551
  </config-file>
2463
2552
  ```
@@ -2636,7 +2725,7 @@ The function is passed a single string parameter containing the error message.
2636
2725
  console.log("Provisional permission granted");
2637
2726
  break;
2638
2727
  case cordova.plugins.diagnostic.permissionStatus.EPHEMERAL:
2639
- console.log("Provisional permission granted");
2728
+ console.log("Ephemeral permission granted");
2640
2729
  break;
2641
2730
  }
2642
2731
  }, function(error){
@@ -2684,11 +2773,11 @@ Requests remote notifications authorization for the application.
2684
2773
 
2685
2774
  ### switchToNotificationSettings()
2686
2775
 
2687
- Platforms: Android
2776
+ Platforms: Android & iOS
2688
2777
 
2689
2778
  Open notification settings for your app
2690
2779
 
2691
- On Android versions lower than O, this will open the same page as `switchToSettings()`.
2780
+ On Android versions lower than O and on iOS versions lower than 15.4, this will open the same page as `switchToSettings()`.
2692
2781
 
2693
2782
  cordova.plugins.diagnostic.switchToNotificationSettings();
2694
2783
 
@@ -3438,7 +3527,7 @@ Checks if the application is authorized to use external storage.
3438
3527
 
3439
3528
  Notes for Android:
3440
3529
  - This is intended for Android 6 / API 23 and above. Calling on Android 5.1 / API 22 and below will always return TRUE as permissions are already granted at installation time.
3441
- - This checks for `READ_EXTERNAL_STORAGE` `CAMERA` run-time permission.
3530
+ - This checks for `READ_EXTERNAL_STORAGE` run-time permission.
3442
3531
 
3443
3532
  ```
3444
3533
  cordova.plugins.diagnostic.isExternalStorageAuthorized(successCallback, errorCallback);
@@ -3556,8 +3645,6 @@ Whereas this method returns:
3556
3645
 
3557
3646
  which are on external removable storage.
3558
3647
 
3559
- - Requires permission for `READ_EXTERNAL_STORAGE` run-time permission which must be added to `AndroidManifest.xml`.
3560
-
3561
3648
  ```
3562
3649
  cordova.plugins.diagnostic.getExternalSdCardDetails(successCallback, errorCallback);
3563
3650
  ```
@@ -3572,7 +3659,7 @@ Each array entry is an object with the following keys:
3572
3659
  - {String} path - absolute path to the storage location
3573
3660
  - {String} filePath - absolute path prefixed with file protocol for use with cordova-plugin-file
3574
3661
  - {Boolean} canWrite - true if the location is writable
3575
- - {Integer} freeSpace - number of bytes of free space on the device on which the storage locaiton is mounted.
3662
+ - {Integer} freeSpace - number of bytes of free space on the device on which the storage location is mounted.
3576
3663
  - {String} type - indicates the type of storage location: either "application" if the path is an Android application sandbox path or "root" if the path is the device root.
3577
3664
  - {Function} errorCallback - The callback which will be called when operation encounters an error.
3578
3665
  The function is passed a single string parameter containing the error message.
@@ -3758,7 +3845,6 @@ This is because the Android camera API requires access to the device's storage t
3758
3845
  On Android <=12, this requires the `WRITE_EXTERNAL_STORAGE` and `READ_EXTERNAL_STORAGE` permissions.
3759
3846
  On Android >12, this requires the `READ_MEDIA_IMAGES` and `READ_MEDIA_VIDEO` permissions.
3760
3847
 
3761
- the `READ_EXTERNAL_STORAGE` permission.
3762
3848
  This is because the [cordova-plugin-camera@2.2+](https://github.com/apache/cordova-plugin-camera) requires both of these permissions.
3763
3849
 
3764
3850
  So to use this method in conjunction with the Cordova camera plugin, make sure you are using the most recent `cordova-plugin-camera` release: v2.2.0 or above.
@@ -3780,17 +3866,17 @@ When requesting permission to use device functionality, a message is displayed t
3780
3866
  These messages are stored in the `{project}-Info.plist` file under `NS*UsageDescription` keys.
3781
3867
 
3782
3868
  Upon installing this plugin into your project, it will add the following default messages to your plist.
3783
- To override these defaults, you can use `<config-file>` blocks in your `config.xml`:
3869
+ To override these defaults, you can use `<edit-config>` blocks in your `config.xml`:
3784
3870
 
3785
3871
  `config.xml`
3786
3872
 
3787
3873
  <platform name="ios">
3788
- <config-file platform="ios" target="*-Info.plist" parent="NSLocationAlwaysUsageDescription">
3874
+ <edit-config file="*-Info.plist" target="NSLocationAlwaysUsageDescription" mode="merge">
3789
3875
  <string>My custom message for always using location.</string>
3790
- </config-file>
3791
- <config-file platform="ios" target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription">
3876
+ </edit-config>
3877
+ <edit-config file="*-Info.plist" target="NSLocationWhenInUseUsageDescription" mode="merge">
3792
3878
  <string>My custom message for using location when in use.</string>
3793
- </config-file>
3879
+ </edit-config>
3794
3880
  </platform>
3795
3881
 
3796
3882
  # Example project
@@ -332,6 +332,31 @@ interface Diagnostic {
332
332
  errorCallback: (error: string) => void
333
333
  ) => void;
334
334
 
335
+ /**
336
+ *
337
+ * Checks if accessibility mode is enabled on device.
338
+ *
339
+ * @param successCallback
340
+ * @param errorCallback
341
+ */
342
+ isAccessibilityModeEnabled?: (
343
+ successCallback: () => boolean,
344
+ errorCallback: (error: string) => void
345
+ ) => void;
346
+
347
+ /**
348
+ * ANDROID ONLY
349
+ *
350
+ * Checks if touch exploration of accessibility mode is enabled on device.
351
+ *
352
+ * @param successCallback
353
+ * @param errorCallback
354
+ */
355
+ isTouchExplorationEnabled?: (
356
+ successCallback: () => boolean,
357
+ errorCallback: (error: string) => void
358
+ ) => void;
359
+
335
360
  /**
336
361
  * Returns details of the OS of the device on which the app is currently running
337
362
  *
@@ -1015,6 +1040,14 @@ interface Diagnostic {
1015
1040
  errorCallback: (error: string) => void
1016
1041
  ) => void;
1017
1042
 
1043
+ /**
1044
+ * Opens the notification settings page for this app.
1045
+ */
1046
+ switchToNotificationSettings?: (
1047
+ successCallback: () => void,
1048
+ errorCallback: (error: string) => void
1049
+ ) => void;
1050
+
1018
1051
  /**
1019
1052
  * ANDROID ONLY
1020
1053
  * Checks if ADB mode(debug mode) is enabled.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "7.1.4",
2
+ "version": "7.2.0",
3
3
  "name": "cordova.plugins.diagnostic",
4
4
  "cordova_name": "Diagnostic",
5
5
  "description": "Cordova/Phonegap plugin to check the state of Location/WiFi/Camera/Bluetooth device settings.",