Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228535 articles
Browse latest View live

Why Ionic has version 5.2.1?

$
0
0

When ever you install ionic /cli@latest ,it always fetch the most latest one. If you want a particular version then you can mention it while installing
eg :npm install -g ionic@3.9.2

Thank you , enjoy coding


Can I build Ionic 3 projects with CLI 5.2.1?

$
0
0

I have an Ionic v3 project - ionic-angular 3.9.6 . I build it with CLI 4.1.1.

If I upgrade the CLI to the latest 5.2.1, will I still be able to build my Ionic 3 project?

I ask because I’m starting to port my Ionic 3 project to Ionic 4 and need to be able to build both the legacy Ionic 3 project and the new Ionic 4 project.

Thanks
Jason

What is the maximum supported version of the iOS version with Ionic v3

$
0
0

Hi Team,

I have an iOS App in Production, build using ionic v3.
I need your help with the following questions:

  1. What is the maximum supported version of the iOS version with Ionic v3?
  2. Will ionic v3 be compatible with iOS 13 and above?
  3. What is your recommendation on Production App running on Ionic v3 with the upcoming iOS updates?

We are using the following configuration:
Ionic version: 3
Angular: 5.2.11
Cordova-iOS: 4.5.5
ionic-native/core: 4.20.0

and including other native packages.
Please let me know if more information is needed for my current configuration.

Thanks,
Pratik

Can I build Ionic 3 projects with CLI 5.2.1?

$
0
0

The CLI should be able to handle that :slight_smile:

The CLI is independent of the Framework.

PayPal Payment INR not working

$
0
0
new PayPalPayment('1000', 'USD', 'Description', 'sale');

but

new PayPalPayment('1000', 'INR', 'Description', 'sale');

not working

IONIC 4 : Loading Controller, dismiss() is called before present() which will keep spinner without dismissing

$
0
0

Hi, I am the one who wrote the solution in stackoverflow and I saw your question when I was checking ionic summary by coincidence :slight_smile: .

Anyway you can achieve what you want by only removing “duration: 5000,” from my code.
I only added this duration in case it took the server more than 5 seconds to respond.
Without it it will work as you want it to work.

God luck

Ionic 4 devapp debugging

$
0
0

if anyone is struggling with this - one requirement is @ionic/angular-toolkit >= 1.5.0

Error in Ionic 4 + dynamic forms

$
0
0

Hi, I got dynamic form working in an old project (probably some setting there) which can make it work, somehow when I tried to create a new project and tried to implement dynamic form only, I got this error message:

ERROR Error: Uncaught (in promise): Error: No template specified for component HomePage
Error: No template specified for component HomePage
at syntaxError (compiler.js:2430)
at DirectiveNormalizer.push…/node_modules/@angular/compiler/fesm5/compiler.js.DirectiveNormalizer.normalizeTemplate (compiler.js:16194)
at CompileMetadataResolver.push…/node_modules/@angular/compiler/fesm5/compiler.js.CompileMetadataResolver.loadDirectiveMetadata (compiler.js:18392)
at compiler.js:26036
at Array.forEach ()
at compiler.js:26035
at Array.forEach ()
at JitCompiler.push…/node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._loadModules (compiler.js:26032)
at JitCompiler.push…/node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler._compileModuleAndComponents (compiler.js:26010)
at JitCompiler.push…/node_modules/@angular/compiler/fesm5/compiler.js.JitCompiler.compileModuleAsync (compiler.js:25970)
at resolvePromise (zone.js:831)
at resolvePromise (zone.js:788)
at zone.js:892
at ZoneDelegate.push…/node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)

I even copied the exact same code to new project, still no luck, probably
I need to change some setting or import package? I actually just try the
example in this link:
https://angular.io/guide/dynamic-form

My home.page.ts:


import { Component } from ‘@angular/core’;

@Component({
selector: ‘app-home’,
//templateUrl: ‘home.page.html’,
styleUrls: [‘home.page.scss’],
})
export class HomePage {

constructor() {}

}

home.module.ts:


import { NgModule } from ‘@angular/core’;
import { CommonModule } from ‘@angular/common’;
import { IonicModule } from ‘@ionic/angular’;
import { FormsModule } from ‘@angular/forms’;
import { RouterModule } from ‘@angular/router’;

import { HomePage } from ‘./home.page’;

@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild([
{
path: ‘’,
component: HomePage
}
])
],
declarations: [HomePage]
})
export class HomePageModule {}

app.component.ts:


import { Component } from ‘@angular/core’;

import { Platform } from ‘@ionic/angular’;
import { SplashScreen } from ‘@ionic-native/splash-screen/ngx’;
import { StatusBar } from ‘@ionic-native/status-bar/ngx’;
import { QuestionService } from ‘./question.service’;

@Component({
selector: ‘app-root’,
templateUrl: ‘app.component.html’
})
export class AppComponent {
questions: any;

constructor(
private platform: Platform,
private splashScreen: SplashScreen,
private statusBar: StatusBar,
private questionService: QuestionService
) {
this.initializeApp();
this.questions = this.questionService.getQuestions();
}

initializeApp() {
this.platform.ready().then(() => {
this.statusBar.styleDefault();
this.splashScreen.hide();
});
}
}

Any suggestion is greatly appreciated!


Ionic 4 devapp debugging

$
0
0

Hi,
I’ve solved using the version 1.5.1, because using @latest it installs the version 2.0.0 that generates another error.
So in the file package .json I have:

    "@ionic/angular-toolkit": "~1.5.1",

Opening pages with ngFor

$
0
0

When you put an *ngFor loop in a tag you’ll end up with multiple of those tags. E.g.,

<ion-list *ngFor="let item of items">

will generate one <ion-list> tag for each item in items. So, if you put

<ion-content *ngFor="let x of someList">

you’ll get multiple <ion-content> tags generated.

Error in Ionic 4 + dynamic forms

$
0
0

Could it be because you have commented out your templateUrl line?:

Redirect to login page if response status 401

$
0
0

This worked for me too. Thank you!

Error in Ionic 4 + dynamic forms

$
0
0

It was commented out in my old project and it worked, it was commented out in purpose for the page to display app.component.html instead.

Liying

Install the Android build tools version 19.1.0 or higher

$
0
0

It gives me problems in the execution of ionic cordova build android

I tried this but it did not work, someone has a better idea

enter here
cd ~ / Library / Android / sdk / tools / bin /
and later
./sdkmanager “build-tools; 27.0.3”
and the version that is asking you
if you get something repositories could not loaded
touch ~ / .android / repositories.cfg
and again
./sdkmanager “build-tools; 27.0.3”

ionic info

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 7.0.0
Ionic Framework    : ionic-angular 3.9.2

System:

Node  : v8.15.0
npm   : 6.4.1
OS    : macOS
Xcode : Xcode 10.2.1 Build version 10E1001

Environment Variables:
ANDROID_HOME : not set

Misc:

backend : pro

cordova requirements
Android Studio project detected

Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
android: Command failed with exit code ENOENT
Gradle: installed /usr/local/Cellar/gradle/5.4.1/bin/gradle
(node:1022) UnhandledPromiseRejectionWarning: CordovaError: Some of requirements check failed

Android Adaptive icons

$
0
0

Which version of cordova-android does Adaptive Icons work with?
I’m now trying to upgrade cordova-android from 6.4 to 8.0 The config.xml values did not work. (Back to merging with AndroidManafest).
Do we need to specify the round icon or does android take care of that (with the new foreground and foreground images)


Uncaught TypeError: (intermediate value).fill is not a function

$
0
0

Same problem. This is very frustrating.
I lost the whole day now debugging this.

We have Android TV boxes (Android 6.0 - Android 8.0) which already worked with a previous version of our app (ionic 4)

Now, since the last time i updated npm & ionic the Android 6.0 boxes are stuck on a blank screen and throw this error (Tested with cordova-android@6 - cordova-android@8). Android 7+ boxes are working without any problem. The Android 6.0 boxes are working with the older ionic3 version of our app without problems.

Any ideas?

Why I won't create apk please help me

$
0
0

Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

Configure project :CordovaLib

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Ionic\myApp\platforms\android\CordovaLib\build.gradle’ line: 41

  • What went wrong:
    A problem occurred evaluating project ‘:CordovaLib’.

Failed to apply plugin [id ‘com.github.dcendents.android-maven’]
Configuration with name ‘testImplementation’ not found.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BU�LD FAILED in 40s
C:\Ionic\myApp\platforms\android\gradlew: Command failed with exit code 1 Error output:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘C:\Ionic\myApp\platforms\android\CordovaLib\build.gradle’ line: 41

  • What went wrong:
    A problem occurred evaluating project ‘:CordovaLib’.

Failed to apply plugin [id ‘com.github.dcendents.android-maven’]
Configuration with name ‘testImplementation’ not found.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BU�LD FAILED in 40s

How to automatically read data from firebase Cloudfirestore if there is change in data

$
0
0

Good morning everyone I want to make Bus tracker app so I am sending driver latitude and longitude to cloud firestore here I am using. Watchpistion() method to automatically update database when there is change in driver location. Now my question is that whenever user views driver location I need to get updated values from cloud firestore.

Is there any method to automatically read data when there is change in data?

How to change ionic 4 checkbox icon?

$
0
0

Hello Everyone.
I am trying to change the checkbox checked icon from tick mark to square box. In earlier versions i made it with css changes. In ionic 4 i was not able to do that because of the shadow DOM. And there is no override css properties to change the icon in the ionic documentation. Is it possible to change the checkbox icon in ionic4??
Thanks in advance.

Ionic 4 WordPress REST User Authenticate Stuck

$
0
0

Hi all, I am trying to authenticate through WP REST and a developer’s bootstrap framework. Attached is the code and whenever I try to login it will stuck at “Loading Please Wait”. Any idea? Thanks in advance.

login.ts

import { Component,OnInit,ViewEncapsulation } from '@angular/core';
import { NavController, ModalController, AlertController, LoadingController } from '@ionic/angular';
import { UserService } from '../../providers/user-service';
import { WoocommerceService } from '../../providers/woocommerce-service';
import { SowService } from '../../providers/sow-service';
import { AppConfig } from '../../app-config';
import { Storage } from '@ionic/storage';
import * as CryptoJS from 'crypto-js';
import { TranslateService } from '@ngx-translate/core';
import {RegisterPage} from '../register/register';
/*
  Generated class for the Login page.

  See http://ionicframework.com/docs/v2/components/#navigation for more info on
  Ionic pages and navigation.
*/
@Component({
  selector: 'app-page-login',
  templateUrl: 'login.html',
  styleUrls: ['login.scss'],
  encapsulation: ViewEncapsulation.None
})
export class LoginPage {
  userName: string;
  password: string;
  email: string;
  errorModal: any;
  constructor(public navCtrl: NavController, public userService: UserService, public wooService: WoocommerceService,
    public appConfig: AppConfig, public alertCtrl: AlertController, public loadingCtrl: LoadingController, public sowService: SowService, public storage: Storage
    , public translateService: TranslateService,public modalCtrl:ModalController) {

  }

  doRegister() {
    this.navCtrl.navigateForward('register');
    this.modalCtrl.dismiss();
  }

   doLogin() {
    this.translateService.get(['Notice', 'Loading', 'NetWork_Error', 'OK', 'Sign_In_Failed', 'Sign_In_No_Email', 'Sign_In_Email_Error', 'No_Email_Or_Password']).
    subscribe(async value => {
      var loadingModal = await this.loadingCtrl.create({
        message: value['Loading']
      });
      if (this.appConfig.Enable_Login_With_Password) {
        if (this.email == null || this.password == null || this.email.trim().length == 0 || this.password.trim().length < 6) {
          var alert=await this.alertCtrl.create({
            header: value['Notice'],
            message: value['No_Email_Or_Password'],
            buttons: [value['OK']]
          });
          alert.present();
          return;
        }

        loadingModal.present();

        var password = this.password;
        if (this.appConfig.App_Secret != '') {
          var key = CryptoJS.enc.Utf8.parse(CryptoJS.MD5(this.appConfig.App_Secret).toString());
          var iv = CryptoJS.enc.Utf8.parse(CryptoJS.MD5(this.appConfig.App_Secret).toString().substr(0, 16));
          password = CryptoJS.AES.encrypt(password, key, { iv: iv }).toString();
        }

        this.sowService.login({ email: this.email, password: encodeURIComponent(password) }).then(async (data: any) => {
          if (data && data != 'error') {
            this.userService.id = data.id;
            this.userService.email = data.email;
            this.userService.first_name = data.first_name;
            this.userService.last_name = data.last_name;
            this.userService.name = data.first_name + data.last_name;
            this.userService.username = data.username;
            this.userService.isAuthenticated = true;

            await this.storage.set('oddwolves-user-info', data);
            loadingModal.dismiss();
            this.modalCtrl.dismiss();

          } else {
            loadingModal.dismiss();
            var alert=await this.alertCtrl.create({
                 header: value['Notice'],
                 message: value['Sign_In_Failed'],
                 buttons: [value['OK']]
             });
            alert.present();

          }
        }, (reson) => {

         loadingModal.dismiss();
        });
      }
      else {
        if (this.email == null || this.email.trim().length == 0) {
          var alert=await this.alertCtrl.create({
            header: value['Notice'],
            message: value['Sign_In_No_Email'],
            buttons: [value['OK']]
          });
          alert.present();
          return;
        }
        loadingModal.present();
        this.wooService.getCustomerByEmail({ email: this.email }).then(async (data: Array<any>) => {
          if (data.length > 0 && data[0] && data[0].id > 0) {
            this.userService.id = data[0].id;
            this.userService.email = data[0].email;
            this.userService.first_name = data[0].first_name;
            this.userService.last_name = data[0].last_name;
            this.userService.name = data[0].first_name + data[0].last_name;
            this.userService.username = data[0].username;
            this.userService.isAuthenticated = true;

             loadingModal.dismiss();
             this.modalCtrl.dismiss();

          } else {
            loadingModal.dismiss();
            var alert=await this.alertCtrl.create({
              header: value['Notice'],
              message: value['Sign_In_Email_Error'],
              buttons: [value['OK']]
            });
            alert.present();
          }
        }, (reson) => {
          loadingModal.dismiss();
        });
      }
    });


  }

  doClose() {
    this.modalCtrl.dismiss();
  }
}

user-service.ts

import { Injectable } from '@angular/core';
// import 'rxjs/add/operator/map';
import { Storage } from '@ionic/storage';
import { AppConfig } from '../app-config';

/*
  Generated class for the UserService provider.

  See https://angular.io/docs/ts/latest/guide/dependency-injection.html
  for more info on providers and Angular 2 DI.
*/
@Injectable({
  providedIn: 'root',
})
export class UserService {
  LOCAL_TOKEN_KEY = 'IonWooShop';
  id = '';
  username = '';
  birthday = '';
  email = '';
  name = '';
  first_name = '';
  last_name = '';
  isAuthenticated = false;
  authToken = '';
  cachedData: any;
  constructor(public storage: Storage, public appConfig: AppConfig) {
    this.LOCAL_TOKEN_KEY = appConfig.Shop_Name;
  }

  loadUserCredentials() {
    this.storage.get(this.LOCAL_TOKEN_KEY).then(user => {
      if (user) {
        this.useCredentials(JSON.parse(user));
      }
    });
  }

  useCredentials(user) {
    this.id = user.id;
    this.username = user.username;
    this.birthday = user.birthday;
    this.email = user.email;
    this.name = user.firstname + ' ' + user.lastname;
    this.first_name = user.firstname ;
    this.last_name = user.lastname;
    this.isAuthenticated = true;
    this.authToken = JSON.stringify(user);
  }

  destroyUserCredentials() {
    this.authToken = undefined;
    this.id = '';
    this.username = '';
    this.birthday = '';
    this.email = '';
    this.name = '';
    this.first_name = '';
    this.last_name = '';
    this.isAuthenticated = false;
    this.storage.remove(this.LOCAL_TOKEN_KEY);
  }
}

Viewing all 228535 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>