MOBILE-4470 Diagnostic.ts: Fix microphone and location usage

main
Alfonso Salces 2024-06-12 08:56:03 +02:00
parent 21e6b789f0
commit 62d65a4ae0
2 changed files with 17 additions and 7 deletions

View File

@ -21,6 +21,14 @@
<param name="android-package" value="com.moodle.moodlemobile.Diagnostic"/>
<param name="onload" value="true" />
</feature>
<feature name="Diagnostic_Microphone">
<param name="android-package" value="com.moodle.moodlemobile.Diagnostic"/>
<param name="onload" value="true" />
</feature>
<feature name="Diagnostic_Location">
<param name="android-package" value="com.moodle.moodlemobile.Diagnostic_Location"/>
<param name="onload" value="true" />
</feature>
</config-file>
<source-file src="src/android/Diagnostic.java" target-dir="src/cordova/plugins" />

View File

@ -62,11 +62,12 @@ export class Diagnostic {
}
isLocationEnabled(): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => cordova.exec(resolve, reject, 'Diagnostic', 'isLocationEnabled'));
return new Promise<boolean>((resolve, reject) => cordova.exec(resolve, reject, 'Diagnostic_Location', 'isLocationEnabled'));
}
switchToLocationSettings(): Promise<void> {
return new Promise<void>((resolve, reject) => cordova.exec(resolve, reject, 'Diagnostic', 'switchToLocationSettings'));
return new Promise<void>((resolve, reject) =>
cordova.exec(resolve, reject, 'Diagnostic_Location', 'switchToLocationSettings'));
}
switchToSettings(): Promise<void> {
@ -75,16 +76,17 @@ export class Diagnostic {
getLocationAuthorizationStatus(): Promise<unknown> {
return new Promise<unknown>((resolve, reject) =>
cordova.exec(resolve, reject, 'Diagnostic', 'getLocationAuthorizationStatus'));
cordova.exec(resolve, reject, 'Diagnostic_Location', 'getLocationAuthorizationStatus'));
}
requestLocationAuthorization(): Promise<void> {
return new Promise<void>((resolve, reject) => cordova.exec(resolve, reject, 'Diagnostic', 'requestLocationAuthorization'));
return new Promise<void>((resolve, reject) =>
cordova.exec(resolve, reject, 'Diagnostic_Location', 'requestLocationAuthorization'));
}
requestMicrophoneAuthorization(): Promise<string> {
return new Promise<string>((resolve, reject) =>
cordova.exec(resolve, reject, 'Diagnostic', 'requestMicrophoneAuthorization'));
cordova.exec(resolve, reject, 'Diagnostic_Microphone', 'requestMicrophoneAuthorization'));
}
}