Skip to content

Commit

Permalink
Merge pull request #3924 from alfonso-salces/MOBILE-4501
Browse files Browse the repository at this point in the history
MOBILE-4501 cordova-plugin-moodleapp: Add diagnostic plugin
  • Loading branch information
NoelDeMartin authored Feb 14, 2024
2 parents 7a9013c + abf2867 commit 829c59e
Show file tree
Hide file tree
Showing 21 changed files with 2,534 additions and 84 deletions.
9 changes: 0 additions & 9 deletions config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,9 @@
</platform>
<platform name="ios">
<resource-file src="GoogleService-Info.plist" />
<edit-config file="*-Info.plist" mode="merge" target="NSLocationWhenInUseUsageDescription">
<string>We need your location so you can attach it as part of your submissions.</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSLocationAlwaysUsageDescription">
<string>We need your location so you can attach it as part of your submissions.</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>We need camera access to take pictures so you can attach them as part of your submissions.</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSMicrophoneUsageDescription">
<string>We need microphone access to record sounds so you can attach them as part of your submissions.</string>
</edit-config>
<edit-config file="*-Info.plist" mode="merge" target="NSPhotoLibraryUsageDescription">
<string>We need photo library access to get pictures from there so you can attach them as part of your submissions.</string>
</edit-config>
Expand Down
80 changes: 80 additions & 0 deletions cordova-plugin-moodleapp/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,30 @@
<param name="android-package" value="com.moodle.moodlemobile.InstallReferrer"/>
</feature>
</config-file>

<config-file target="res/xml/config.xml" parent="/*">
<feature name="Diagnostic" >
<param name="android-package" value="com.moodle.moodlemobile.Diagnostic"/>
<param name="onload" value="true" />
</feature>
</config-file>

<js-module name="Diagnostic" src="www/android/diagnostic.js">
<merges target="com.moodle.moodlemobile.diagnostic" />
</js-module>

<source-file src="src/android/Diagnostic.java" target-dir="src/cordova/plugins" />
<source-file src="src/android/Diagnostic_Location.java" target-dir="src/cordova/plugins" />

<preference name="ANDROIDX_VERSION" default="1.0.0" />
<preference name="ANDROIDX_APPCOMPAT_VERSION" default="1.3.1" />
<framework src="androidx.legacy:legacy-support-v4:$ANDROIDX_VERSION" />
<framework src="androidx.appcompat:appcompat:$ANDROIDX_APPCOMPAT_VERSION" />

<source-file src="src/android/SecureStorage.java" target-dir="src/com/moodle/moodlemobile" />
<source-file src="src/android/InstallReferrer.java" target-dir="src/com/moodle/moodlemobile" />
</platform>

<platform name="ios">
<config-file target="config.xml" parent="/*">
<feature name="SecureStorage">
Expand All @@ -27,5 +48,64 @@

<header-file src="src/ios/SecureStorage.h" />
<source-file src="src/ios/SecureStorage.m" />

<config-file target="config.xml" parent="/*">
<feature name="Diagnostic">
<param name="ios-package" value="Diagnostic" />
<param name="onload" value="true" />
</feature>
</config-file>

<js-module src="www/ios/diagnostic.js" name="Diagnostic">
<merges target="com.moodle.moodlemobile.diagnostic" />
</js-module>

<header-file src="src/ios/Diagnostic.h" />
<source-file src="src/ios/Diagnostic.m" />

<!--BEGIN_MODULE LOCATION-->
<config-file target="config.xml" parent="/*">
<feature name="Diagnostic_Location">
<param name="ios-package" value="Diagnostic_Location" />
<param name="onload" value="true" />
</feature>
</config-file>

<header-file src="src/ios/Diagnostic_Location.h" />
<source-file src="src/ios/Diagnostic_Location.m" />

<framework src="CoreLocation.framework" />

<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>

<config-file target="*-Info.plist" parent="NSLocationAlwaysUsageDescription" comment="iOS 10">
<string>We need your location so you can attach it as part of your submissions.</string>
</config-file>
<!--END_MODULE LOCATION-->

<!--BEGIN_MODULE MICROPHONE-->
<config-file target="config.xml" parent="/*">
<feature name="Diagnostic_Microphone">
<param name="ios-package" value="Diagnostic_Microphone" />
<param name="onload" value="true" />
</feature>
</config-file>

<js-module src="www/ios/diagnostic.js" name="Diagnostic_Microphone">
<merges target="com.moodle.moodlemobile.microphone" />
</js-module>

<framework src="AVFoundation.framework" />

<config-file target="*-Info.plist" parent="NSMicrophoneUsageDescription">
<string>We need microphone access to record sounds so you can attach them as part of your submissions.</string>
</config-file>

<header-file src="src/ios/Diagnostic_Microphone.h" />
<source-file src="src/ios/Diagnostic_Microphone.m" />
<!--END_MODULE MICROPHONE-->

</platform>
</plugin>
Loading

0 comments on commit 829c59e

Please sign in to comment.