We noticed that with EAS build, we could use some non-expo-included react-native modules,
there is one module that we need to use in our project called “react-native-minimizer”
it provides a native function called NativeModules.Minimizer for app to navigate back last app or minimize in Android or iOS
But now after I installed the react-native package and build our app by eas build, the module was not functioned.
-We are using EAS build by command “eas build --profile=development -p ios --non-interactive”, I think it is managed flow ?
-We just installed the package by “yarn add react-native-minimizer”, without any other command
-We are using eas-cli@2.6.0, and the node version is 16.15.0
To use a third-party lib it needs to have a config plugin that configures it for expo, or there is no native setup necessary to make it work other than yarn add and pod install
readme on older version contains instructions for native config react-native-minimizer - npm If you want to use that, you would need to write config plugin yourself or switch to bare workflow
That depends on what you would need to do for a plain React Native project to install the module.
Where are you getting it from? According to the description of the react-native-minimizer module on npm (see wkozyra’s message) it only exports a multiply function. It links to a non-existent GitHub project. It does not seem very trustworthy to me.
Based on the installation instructions in the older version you just need a config plugin to add the maven URL to the build.gradle file. I am not an expert on build.gradle, though, so I don’t know exactly what that line does. It seems like it would be looking for a filesystem directory rather than a maven repository on the Internet, so I’m not sure if it would find the directory. But if you trust this module you could try it and see.
But you might find it easier to look for existing config plugins to find one that does something similar to what you do and then use those as a guide for writing your own.
The rest is all boilerplate or unused. This is an Android-only module. The iOS code is just sample code and so is the “multiply” documentation.
I had a bit of a search and could not find moveTaskToBack or equivalent in React Native or e.g. React Navigation.
In theory you should be able to implement minimize using IntentLauncher, but I gave it a try and was not able to get it to work properly. If you want to give it a try it would be something like this:
But if you want to use coder89/react-native-minimizer then it looks like it should work without the need of a config plugin or anything special. You would just need to create a development build and then use the development build instead of Expo Go.
Perhaps the problem is with how you are importing or calling the minimize function.
Try something like:
import { goBack, minimize } from "react-native-minimizer";
// ...
minimize();
The iOS code from version 1.3.5 looks more promising, yes.
I’m afraid you will need to contact the authors of that library to ask about it if it doesn’t work.
It sounds like you are able to build the app successfully and you are able to call it. If it doesn’t work then it sounds like a bug in that library and you’ll have to contact them about it.