How do you update the iOS & Android app version in Ionic w/ Capacitor?

So, Capacitor is neat! The android and ios configs are actually committed to source control. To update version number, simply update the following files: Android – android/app/build.gradle (you’re looking for the versionName variable) iOS – ios/App/App/Info.plist *(you’re looking for the CFBundleShortVersionString key)

NavController doesn’t work in Ionic 4

Now, to complete the final step and implement those routes in our app-routing.module.ts file, they would look like this: const routes: Routes = [ { path: ”, redirectTo: ‘/home’, pathMatch: ‘full’ }, { path: “https://stackoverflow.com/questions/51828017/home”, loadChildren: ‘./pages/home/home.module#HomeModule’ }, { path: ‘products’, loadChildren: ‘./pages/products/products.module#ProductsModule’}, { path: ‘products/:id’, loadChildren: ‘./pages/product-detail/product-detail.module#ProductDetailModule’ }, { path: ‘products/categories’, loadChildren: ‘./pages/product-categories/product-categories. { … Read more

ionic 4: changing ion-content background does not work

You can use the CSS-Variable –background to change the background of ion-content. Example: ion-content{ –background: #fff url(‘../../assets/images/cover.jpg’) no-repeat center center / cover; } Put this into your components, pages or global scss. For reference see: https://beta.ionicframework.com/docs/api/content#css-custom-properties

Ionic 4: “Loading Controller” dismiss() is called before present() which will keep spinner without dismissing

this is how I solved my issue.. I used a boolean variable “isLoading” to change to false when dismiss() is called. after present() is finished if “isLoading” === false (means dismiss() already called) then it will dismiss immediately. also, I wrote the code in a service so I don’t have to write it again in … Read more

Ionic 4 custom components

Finally figured this out, here’s a repro that works: ionic start myProject blank –type=angular ionic g module components ionic g component components/myComponent –export This adds both a declaration and export to the components module for “myComponent”. To use the component just add ComponentsModule to your imports in your page module, e.g. @NgModule({ imports: [ CommonModule, … Read more

Ionic 5 with Angular 9 – Angular JIT compilation failed: ‘@angular/compiler’ not loaded

Updated & correct solution to fix this Based on the answer from Tran Quang, I went to see the CHANGELOG.md of ionic-native and came to know that they recently updated their package to compile with Angular 9. Hence you need to update any/all dependencies of @ionic-native. For this, look at all the dependencies in your … Read more

Ionic 5 – How to replace default icon and splash screen image and generate resources

Automatic icon and splash screen resizing CLI tool for Capacitor based applications. It automatically resizes and copies your icon.png and splash.png files to platform dedicated directories. It does NOT require any external binary libraries. Javascript only. Installation $ npm install capacitor-resources -g Usage Required files Add your icon.png (1024×1024 px) and splash.png (2732×2732 px) files … Read more

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

tech