how to check app running in foreground or background in ionic/cordova/phonegap

Use the two Events “Pause” and “Resume“. You will find all Events here in the Apache Cordova Events Documentation. Event – Pause: The pause event fires when the native platform puts the application into the background, typically when the user switches to a different application. Event – Resume The resume event fires when the native … Read more

Cordova : [Error: Please install Android target: “android-21”

I just had the same problem. I had to change the target: # Project target. target=android-22 This should be done in two files: myApp/platforms/android/project.properties myApp/platforms/android/CordovaLib/project.properties Also the manifest should be updated: <uses-sdk android:minSdkVersion=”14″ android:targetSdkVersion=”22″ />

Ionic android build Error – Failed to find ‘ANDROID_HOME’ environment variable

Android Home should be the root folder of SDK. export ANDROID_HOME=”$HOME/android-sdk-linux” EDIT: Open terminal and type these commands. (yes, on a ternimal , not in bashrc file) export ANDROID_HOME=~/android-sdk-macosx PATH=$PATH:$ANDROID_HOME/tools PATH=$PATH:$ANDROID_HOME/platform-tools and then in the same terminal just type android. If configured you would be able to use build commands from this terminal. (it’s a … Read more

What is the difference between apache cordova and ionic?

Apache Cordova is a community project, letting you build mobile apps for various mobile platforms with one unique code base, as you develop your app with web technologies (HTML5, Javascript and CSS3) instead of relying on platform-specific (native) APIs like those of Android, iOS, or Windows Phone. Phonegap is a version of Cordova but it’s … Read more

How to get device width and height in Ionic using TypeScript?

You can use the Platform information for this. Internally the platform uses the window.innerWidth and window.innerHeight but Using this method is preferred since the dimension is a cached value, which reduces the chance of multiple and expensive DOM reads. Ionic 4/5 Docs: https://ionicframework.com/docs/angular/platform#width-number import { Component } from ‘@angular/core’; import { Platform } from ‘@ionic/angular’; … Read more

Ionic 2: ReferenceError: webpackJsonp is not defined

Literally just went through the same thing as you are. I added the vendor.js script BEFORE the main.js in /src/index.html – now it runs locally. <!– The polyfills js is generated during the build process –> <script src=”https://stackoverflow.com/questions/44988166/build/polyfills.js”></script> <script src=”https://stackoverflow.com/questions/44988166/build/vendor.js”></script> <!– The bundle js is generated during the build process –> <script src=”https://stackoverflow.com/questions/44988166/build/main.js”></script>

Problem with play-services-measurement-base on ionic

No solutions posted here worked for me. A wonderful person opened a pull request in the cordova-firebase-plugin official repo and it works. Steps I did: 1 – Remove cordova-firebase-plugin with ionic cordova plugin remove cordova-plugin-firebase 2 – Install: ionic cordova plugin add cordova-plugin-firebasex 3 – rm -rf node_modules/ plugins/ platforms/android package-lock.json 4 – ionic cordova … Read more