Native: tried calling BackgroundMode.enable, but the BackgroundMode plugin is not installed - ionic4

I follow https://ionicframework.com/docs/native/background-mode for background mode but i got "Native: tried calling BackgroundMode.enable, but the BackgroundMode plugin is not installed." warning on console error plugin not installed.
1. install ionic cordova plugin add cordova-plugin-background-mode
2. npm install #ionic-native/background-mode
3. import library into app.module.ts "import { BackgroundMode } from '#ionic-native/background-mode/ngx';
" and add into provider.
4. add into main file app.component.ts on this.platform.ready
this.backgroundMode.enable();
console.log(this.backgroundMode.isActive());

If you already are using a mobile device just run:
"ionic cordova prepare android" before running your app.
If you are trying to use this plugins with "ionic serve" you can't you need to use mobile device/simulator or run into the platform browser with:
"ionic serve --cordova --platform browser"
I really don't recommend using browser since it doesn't work very well in my opinion, my suggestion is use a phone.

Related

react-native app crashes while I want to run debugger-ui react-native-debbugger

I have started my application and install npm packages using npm install, then as usual I have installed debug version of the application using npx react-native run-android, then started the application with npx react-native start. The works fine until I want to use debugger-ui and debug my application using react-native-debugger or fb-flipper.
The problem occurs when pressing r in the terminal and choosing Debug from the modal that appears on the emulator screen.
This is the error that I'm facing with int he terminal:
And also this one in the React Native Debugger tab in the chrome console:
As I'm using the latest version of react-native-reanimated in this project and have followed the installation instructions in the documentation I have used this command for installing that:
npm install react-native-reanimated#next
I have been looking into documentation and after reading that really carefully I have just figured out that the react-native-reanimated#2 is not going to work with react-native-debugger and you can run debugger-ui the documentation recommended to use facebook flipper another amazing developer tool for react-native apps.

Cordova plugin with Capacitor and Quasar

I'm building an app with Quasar and Capacitor.
I'd like to use phonegap-plugin-barcodescanner(or is there any other option for QR reading?).
I've installed plugin with npm i phonegap-plugin-barcodescanner to src-capacitor project. What's my next steps, do I need to register it in capacitor.config?
How do I call scan function on it?
I've figured it out. You need to run npx cap sync in src-capacitor folder. And than the plugin accessible via cordova.plugins.barcodeScanner like it was previously with Cordova

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. error while installing some libraries

I am trying to create one react native app with Drawer navigation with menu in header using stack navigation like below
I have installed packages like below
1.npm install react-navigation
2.npm add react-native-reanimated react-native-gesture-handler react-native-screens#^1.0.0-alpha.23
3.npm add react-navigation-drawer
After that it's working as expected like below for drawer menu
then am trying to create menu in header by using stack navigation after executing npm install react-navigation-stack am getting below error while running app
sometimes after installing react-native-vector-icons also am getting same error, please help in this thanks in advance
try this;
open your cmd, navigate to your project directory
cd into android
then
run
./gradlew clean
then re-run the app or install the package you want like the ICONS one! and try
npx react-native run-android
that should help;
otherwise, see this link and follow steps to install multi dex and then repeat the above-said steps!
as a Side Note: you should! update android studio, plugins and
rebuild the app with latest android and Gradle

pakage .json file cannot add android platform

I cannot able to add android platform in package.json file after installing firebase cloud messaging.
"platforms": [
]
}
This is not very clear what you're saying but the way to add the android platform is to use the Ionic CLI.
You have options to use Cordova or Capacitor.
If you are just starting out it's probably best to use Cordova.
You type this into the command line:
ionic cordova platform add android
The documentation for this command is here:
ionic cordova platform - Ionic Documentation
This will update the json files for you and add all the required configuration.
You should review the documentation though if this is your first time as there are many steps before this to configure your machine:
https://ionicframework.com/docs/installation/environment
https://ionicframework.com/docs/installation/android
https://ionicframework.com/docs/building/android

A dummies guide to installing a PhoneGap plugin

I am trying to build a basic QR code scanning app but I am not exactly sure how to add a plugin. I am trying to install - https://www.npmjs.com/package/cordova-plugin-barcodescanner
I have installed NPM, GIT and Cordova, and have deployed a Framework 7 based app from the phonegap software that has the following directory:
C:\Users\user\Documents\Phonegap Apps\Saving Energy\Android
I am unsure how to install the plugin? Do I run
npm i cordova-plugin-barcodescanner
in Windows Command Prompt, and if so do I have to change the directory to my app plugin folder? Do I run it using node.js? Etc.
You can add plugin easily using cordova
you should open command prompt with Saving Energy as directory and run
cordova plugin add [cordova-plugin-name]
For your case it is
cordova plugin add cordova-plugin-barcodescanner
Hope it Helps!