Merge pull request #4092 from alfonso-salces/MOBILE-4470

Mobile 4470
main
Dani Palou 2024-06-13 10:42:11 +02:00 committed by GitHub
commit 1934993d8c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 7 deletions

View File

@ -17,10 +17,18 @@
</config-file>
<config-file target="res/xml/config.xml" parent="/*">
<feature name="Diagnostic" >
<feature name="Diagnostic">
<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" />
@ -45,7 +53,7 @@
<header-file src="src/ios/SecureStorage.h" />
<source-file src="src/ios/SecureStorage.m" />
<config-file target="config.xml" parent="/*">
<config-file target="config.xml" parent="/*">
<feature name="Diagnostic">
<param name="ios-package" value="Diagnostic" />
<param name="onload" value="true" />
@ -68,6 +76,10 @@
<framework src="CoreLocation.framework" />
<config-file target="*-Info.plist" parent="NSLocationAlwaysAndWhenInUseUsageDescription" comment="Default usage descriptions: override as necessary in .plist">
<string>We need your location so you can attach it as part of your submissions.</string>
</config-file>
<config-file target="*-Info.plist" parent="NSLocationWhenInUseUsageDescription" comment="Default usage descriptions: override as necessary in .plist">
<string>We need your location so you can attach it as part of your submissions.</string>
</config-file>

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'));
}
}