refactor: migrate all cordova plugins to capacitor

This commit is contained in:
Thea Schöbl
2022-02-17 08:37:32 +00:00
committed by Rainer Killinger
parent cdb6ac4084
commit 75f4644940
36 changed files with 677 additions and 1118 deletions

View File

@@ -47,5 +47,5 @@ try {
apply plugin: 'com.google.gms.google-services'
}
} catch(Exception e) {
logger.warn("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
logger.info("google-services.json not found, google-services plugin not applied. Push Notifications won't work")
}

View File

@@ -15,17 +15,18 @@ dependencies {
implementation project(':capacitor-device')
implementation project(':capacitor-dialog')
implementation project(':capacitor-filesystem')
implementation project(':capacitor-geolocation')
implementation project(':capacitor-haptics')
implementation project(':capacitor-keyboard')
implementation project(':capacitor-local-notifications')
implementation project(':capacitor-network')
implementation project(':capacitor-share')
implementation project(':capacitor-splash-screen')
implementation project(':capacitor-status-bar')
implementation project(':capacitor-storage')
implementation project(':transistorsoft-capacitor-background-fetch')
implementation project(':capacitor-secure-storage-plugin')
implementation "androidx.legacy:legacy-support-v4:1.0.0"
implementation "androidx.appcompat:appcompat:1.3.1"
implementation "com.android.support:support-v4:27.+"
}

View File

@@ -1,19 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<manifest package="de.anyschool.app" xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
android:label="@string/title_activity_main"
android:launchMode="singleTask"
android:name="de.anyschool.app.MainActivity"
android:theme="@style/AppTheme.NoActionBarLaunch">
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme" android:usesCleartextTraffic="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode" android:label="@string/title_activity_main" android:launchMode="singleTask" android:name="de.anyschool.app.MainActivity" android:theme="@style/AppTheme.NoActionBarLaunch">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
@@ -31,13 +19,12 @@
<data android:host="@string/app_host" android:scheme="https" />
</intent-filter>
</activity>
<provider android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true"
android:name="androidx.core.content.FileProvider">
<provider android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true" android:name="androidx.core.content.FileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
</provider>
</application>
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature android:name="android.hardware.location.gps" />
</manifest>

View File

@@ -6,17 +6,25 @@
"cordova": {
"preferences": {
"AndroidXEnabled": "true",
"ScrollEnabled": "false",
"android-minSdkVersion": "22",
"BackupWebStorage": "none",
"SplashMaintainAspectRatio": "true",
"FadeSplashScreenDuration": "300",
"SplashShowOnlyFirstTime": "false",
"SplashScreen": "screen",
"SplashScreenDelay": "3000"
"BackupWebStorage": "none"
}
},
"plugins": {
"SplashScreen": {
"launchShowDuration": 6000,
"launchAutoHide": false,
"backgroundColor": "#ffffff",
"androidSplashResourceName": "splash",
"androidScaleType": "FIT_CENTER",
"showSpinner": false,
"androidSpinnerStyle": "large",
"iosSpinnerStyle": "small",
"spinnerColor": "#999999",
"splashFullScreen": false,
"splashImmersive": false,
"useDialog": false
},
"LocalNotifications": {}
}
}

View File

@@ -23,6 +23,10 @@
"pkg": "@capacitor/filesystem",
"classpath": "com.capacitorjs.plugins.filesystem.FilesystemPlugin"
},
{
"pkg": "@capacitor/geolocation",
"classpath": "com.capacitorjs.plugins.geolocation.GeolocationPlugin"
},
{
"pkg": "@capacitor/haptics",
"classpath": "com.capacitorjs.plugins.haptics.HapticsPlugin"
@@ -35,6 +39,10 @@
"pkg": "@capacitor/local-notifications",
"classpath": "com.capacitorjs.plugins.localnotifications.LocalNotificationsPlugin"
},
{
"pkg": "@capacitor/network",
"classpath": "com.capacitorjs.plugins.network.NetworkPlugin"
},
{
"pkg": "@capacitor/share",
"classpath": "com.capacitorjs.plugins.share.SharePlugin"

View File

@@ -6,75 +6,12 @@
<param name="android-package" value="nl.xservices.plugins.Calendar"/>
</feature>
<feature name="Device">
<param name="android-package" value="org.apache.cordova.device.Device"/>
</feature>
<feature name="Notification">
<param name="android-package" value="org.apache.cordova.dialogs.Notification"/>
</feature>
<feature name="Geolocation">
<param name="android-package" value="org.apache.cordova.geolocation.Geolocation"/>
</feature>
<feature name="NetworkStatus">
<param name="android-package" value="org.apache.cordova.networkinformation.NetworkManager"/>
</feature>
<feature name="Whitelist">
<param name="android-package" value="org.apache.cordova.whitelist.WhitelistPlugin"/>
<param name="onload" value="true"/>
</feature>
<feature name="Diagnostic">
<param name="android-package" value="cordova.plugins.Diagnostic"/>
<param name="onload" value="true"/>
</feature>
<feature name="Diagnostic_Location">
<param name="android-package" value="cordova.plugins.Diagnostic_Location"/>
<param name="onload" value="true"/>
</feature>
<feature name="Diagnostic_Bluetooth">
<param name="android-package" value="cordova.plugins.Diagnostic_Bluetooth"/>
<param name="onload" value="true"/>
</feature>
<feature name="Diagnostic_Wifi">
<param name="android-package" value="cordova.plugins.Diagnostic_Wifi"/>
<param name="onload" value="true"/>
</feature>
<feature name="Diagnostic_Camera">
<param name="android-package" value="cordova.plugins.Diagnostic_Camera"/>
<param name="onload" value="true"/>
</feature>
<feature name="Diagnostic_Notifications">
<param name="android-package" value="cordova.plugins.Diagnostic_Notifications"/>
<param name="onload" value="true"/>
</feature>
<feature name="Diagnostic_NFC">
<param name="android-package" value="cordova.plugins.Diagnostic_NFC"/>
<param name="onload" value="true"/>
</feature>
<feature name="Diagnostic_External_Storage">
<param name="android-package" value="cordova.plugins.Diagnostic_External_Storage"/>
<param name="onload" value="true"/>
<feature name="FileOpener2">
<param name="android-package" value="io.github.pwlin.cordova.plugins.fileopener2.FileOpener2"/>
</feature>
<preference name="AndroidXEnabled" value="true" />
<preference name="ScrollEnabled" value="false" />
<preference name="android-minSdkVersion" value="22" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="false" />
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
</widget>

View File

@@ -1,7 +1,7 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()

View File

@@ -20,6 +20,9 @@ project(':capacitor-dialog').projectDir = new File('../node_modules/@capacitor/d
include ':capacitor-filesystem'
project(':capacitor-filesystem').projectDir = new File('../node_modules/@capacitor/filesystem/android')
include ':capacitor-geolocation'
project(':capacitor-geolocation').projectDir = new File('../node_modules/@capacitor/geolocation/android')
include ':capacitor-haptics'
project(':capacitor-haptics').projectDir = new File('../node_modules/@capacitor/haptics/android')
@@ -29,6 +32,9 @@ project(':capacitor-keyboard').projectDir = new File('../node_modules/@capacitor
include ':capacitor-local-notifications'
project(':capacitor-local-notifications').projectDir = new File('../node_modules/@capacitor/local-notifications/android')
include ':capacitor-network'
project(':capacitor-network').projectDir = new File('../node_modules/@capacitor/network/android')
include ':capacitor-share'
project(':capacitor-share').projectDir = new File('../node_modules/@capacitor/share/android')