From 4f49b48fc52cd85c2aaacc083c3ac0668ae355b1 Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Wed, 29 Apr 2020 10:10:36 +0200 Subject: [PATCH] Disabled some expo unimodules --- android/app/build.gradle | 14 +++++++--- .../generated/BasePackageList.java | 9 +----- src/screens/Proxiwash/ProxiwashScreen.js | 28 +++++++++---------- src/utils/Notifications.js | 20 ++++++------- 4 files changed, 35 insertions(+), 36 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 1bbe0f1..a3a13d8 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -83,9 +83,6 @@ project.ext.react = [ apply from: '../../node_modules/react-native-unimodules/gradle.groovy' apply from: "../../node_modules/react-native/react.gradle" -project.ext.vectoricons = [ - iconFontNames: [ 'MaterialCommunityIcons.ttf'] // Name of the font files you want to copy -] apply from: "../../node_modules/react-native-vector-icons/fonts.gradle" @@ -196,7 +193,16 @@ android { dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.facebook.react:react-native:+" // From node_modules - addUnimodulesDependencies() + addUnimodulesDependencies([exclude: [ + 'expo-error-recovery', + 'expo-image-loader', + 'expo-keep-awake', + 'expo-linear-gradient', + 'expo-location', + 'expo-web-browser', + 'expo-sqlite', + 'expo-image-loader', + ]]) if (enableHermes) { def hermesPath = "../../node_modules/hermes-engine/android/"; diff --git a/android/app/src/main/java/fr/amicaleinsat/application/generated/BasePackageList.java b/android/app/src/main/java/fr/amicaleinsat/application/generated/BasePackageList.java index 214de2f..366f99f 100644 --- a/android/app/src/main/java/fr/amicaleinsat/application/generated/BasePackageList.java +++ b/android/app/src/main/java/fr/amicaleinsat/application/generated/BasePackageList.java @@ -10,16 +10,9 @@ public class BasePackageList { new expo.modules.barcodescanner.BarCodeScannerPackage(), new expo.modules.camera.CameraPackage(), new expo.modules.constants.ConstantsPackage(), - new expo.modules.errorrecovery.ErrorRecoveryPackage(), new expo.modules.filesystem.FileSystemPackage(), new expo.modules.font.FontLoaderPackage(), - new expo.modules.imageloader.ImageLoaderPackage(), - new expo.modules.keepawake.KeepAwakePackage(), - new expo.modules.lineargradient.LinearGradientPackage(), - new expo.modules.location.LocationPackage(), - new expo.modules.permissions.PermissionsPackage(), - new expo.modules.sqlite.SQLitePackage(), - new expo.modules.webbrowser.WebBrowserPackage() + new expo.modules.permissions.PermissionsPackage() ); } } diff --git a/src/screens/Proxiwash/ProxiwashScreen.js b/src/screens/Proxiwash/ProxiwashScreen.js index 80ad84c..8771f1a 100644 --- a/src/screens/Proxiwash/ProxiwashScreen.js +++ b/src/screens/Proxiwash/ProxiwashScreen.js @@ -1,12 +1,12 @@ // @flow import * as React from 'react'; -import {Alert, Platform, View} from 'react-native'; +import {Alert, View} from 'react-native'; import i18n from "i18n-js"; import WebSectionList from "../../components/Screens/WebSectionList"; import * as Notifications from "../../utils/Notifications"; import AsyncStorageManager from "../../managers/AsyncStorageManager"; -import * as Expo from "expo"; +// import * as Expo from "expo"; import {Avatar, Banner, Button, Card, Text, withTheme} from 'react-native-paper'; import ProxiwashListItem from "../../components/Lists/Proxiwash/ProxiwashListItem"; import ProxiwashConstants from "../../constants/ProxiwashConstants"; @@ -92,18 +92,18 @@ class ProxiwashScreen extends React.Component { this.setState({machinesWatched: fetchedList}) }); // Get updated watchlist after received notification - Expo.Notifications.addListener(() => { - Notifications.getMachineNotificationWatchlist((fetchedList) => { - this.setState({machinesWatched: fetchedList}) - }); - }); - if (Platform.OS === 'android') { - Expo.Notifications.createChannelAndroidAsync('reminders', { - name: 'Reminders', - priority: 'max', - vibrate: [0, 250, 250, 250], - }); - } + // Expo.Notifications.addListener(() => { + // Notifications.getMachineNotificationWatchlist((fetchedList) => { + // this.setState({machinesWatched: fetchedList}) + // }); + // }); + // if (Platform.OS === 'android') { + // Expo.Notifications.createChannelAndroidAsync('reminders', { + // name: 'Reminders', + // priority: 'max', + // vibrate: [0, 250, 250, 250], + // }); + // } } } diff --git a/src/utils/Notifications.js b/src/utils/Notifications.js index c4ab06e..b83ca38 100644 --- a/src/utils/Notifications.js +++ b/src/utils/Notifications.js @@ -1,7 +1,7 @@ // @flow import {checkNotifications, requestNotifications, RESULTS} from 'react-native-permissions'; -import {Notifications} from 'expo'; +// import {Notifications} from 'expo'; import AsyncStorageManager from "../managers/AsyncStorageManager"; import LocaleManager from "../managers/LocaleManager"; import passwords from "../../passwords"; @@ -40,15 +40,15 @@ export async function askPermissions() { * @return {Promise} */ export async function initExpoToken() { - let token = AsyncStorageManager.getInstance().preferences.expoToken.current; - if (token === '') { - askPermissions().then(() => { - Notifications.getExpoPushTokenAsync().then((token) => { - // Save token for instant use later on - AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.expoToken.key, token); - }); - }); - } + // let token = AsyncStorageManager.getInstance().preferences.expoToken.current; + // if (token === '') { + // askPermissions().then(() => { + // Notifications.getExpoPushTokenAsync().then((token) => { + // // Save token for instant use later on + // AsyncStorageManager.getInstance().savePref(AsyncStorageManager.getInstance().preferences.expoToken.key, token); + // }); + // }); + // } } /**