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

Constant 503 errors from resources

$
0
0

You forgot to uninstall ionic first

npm uninstall -g ionic
then
npm i -g @ionic/cli

It helped to fix.

The main issue is old ionic cli 3 version send images to cloud.
New Ionic cli 6 version convert images locally


React native

$
0
0

What are new updates in react native?

Ionic Http appending header

$
0
0

API end point is HTTPS.

But same working fine in Android / Web platforms.

Do we need to enable “Access-Control-Allow-Headers” : “Authorization” in server.

IONIC Online tutor Plattforms

$
0
0

Hi,

lets talk about that idea.
If you have ZOOM ( www.zoom.us/download ) installed, lets get together and talk.
Let me know, when you are ready to meet.

Brg Dietmar

Ionic 5 auto complete

$
0
0

yes i have imported "IonicSelectableModule " in both pages app.module.ts and home.module.ts

afterthat i get this below error i am using ionic v5.4.13

  1. If ‘ionic-selectable’ is an Angular component and it has ‘items’ input, then verify that it is part of this module.
  2. If ‘ionic-selectable’ is a Web Component then add ‘CUSTOM_ELEMENTS_SCHEMA’ to the ‘@NgModule.schemas’ of this component to suppress this message.
  3. To allow any property add ‘NO_ERRORS_SCHEMA’ to the ‘@NgModule.schemas’ of this component. (“rm-control” placeholder=“Select Account”
    [(ngModel)]=“selected_account”
    [ERROR ->][items]=“arrAccountName”
    itemValueField=“accountname”
    itemTextField=“acco”): ng:///ContactsPageModule/SynccrmcontactPage.html@52:14
    ‘ionic-selectable’ is not a known element:

Thanks
Ramji

Ionic Cordova commands takes so much time to run

$
0
0

For your info, i am working in ionic5 project.

For the past 2-3 days, i am not able to run the ionic projects.

It takes so much time to execute the command.

All the below commands stuck at the first line itself.

cordova platform add android
cordova platform add android --verbose

ionic cordova build android --prod --aot --minifyjs --minifycss --optimizejs
ionic cordova run android --no-native-run
ionic cordova run android --prod --no-native-run

I have downgraded cordova version.

I have uninstalled ionic and cordova too.

But still the command stops at first line.

My ionic info:

$ ionic info

Ionic:

Ionic CLI : 5.4.16
Ionic Framework : @ionic/angular 5.1.1
@angular-devkit/build-angular : 0.901.7
@angular-devkit/schematics : 9.1.7
@angular/cli : 9.1.7
@ionic/angular-toolkit : 2.2.0

Cordova:

Cordova CLI : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.1.0
Cordova Plugins : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 5 other plugins)

Utility:

cordova-res : 0.8.0
native-run : not installed

System:

Android SDK Tools : 26.1.1
NodeJS : v10.16.3
npm : 6.9.0
OS : Windows 10

image

image

Please anyone help me to take android build. Its urgent as i need to take android build.

IONIC app call web service every 1 minute

$
0
0

I want to send the google navigation api duration time value to the web service every 1 minute not only in home page across all the pages when the app is in use and clear the interval when google map navigation is completed.
I tried setInterval, Observable timers solutions but it keeps running and sometimes not. What is the proper way of calling the web service every 1 minute in ionic application? please help me

Printing on bluetooth printers

$
0
0

same here, do you find out the solution???


ERR_CLEARTEXT_NOT_PERMITTED in debug app on Android

$
0
0

Hi! I have a solution: You’ve to set text traffic to true and add the ip that you will use instead of localhost.

How? Check if you have network security config file such as:

network_security_config.xml"

In my case the file is in resources/android/xml

Then set the code like this:

<network-security-config>
    <domain-config cleartextTrafficPermitted="true">
        <domain includeSubdomains="true">localhost</domain> //Default domain
        <domain includeSubdomains="true">your_new_ip(ex. 11.0.2.3)</domain> //put the ip that your are using 
    </domain-config>

    <base-config cleartextTrafficPermitted="false"/>
</network-security-config> 

what you have done has been adding a new ip (11.0.2.3) to the security configuration.
Also check that cleartextTrafficPermitted is true

Hope it helps!

Admob work fine in test but Not in Real Admob

$
0
0

If you had android studio you should be able to see the problem on the console log, just make sure you have the catch on your code.

Printing on bluetooth printers

$
0
0
Actually you dont need mutable buffer, you can use it like this when preparing for print

            let CMD = this.data;  // data are shortcut codes declared before
            let printtext = ' ';
            printtext+= CMD.TEXT_FORMAT.TXT_ALIGN_CT;
            printtext+=  "Some text here";
            printtext+= CMD.TEXT_FORMAT.TXT_ALIGN_CT;
            printtext+= CMD.EOL;
            printtext+=  "Some text here";
            printtext+= CMD.TEXT_FORMAT.TXT_ALIGN_CT;
            printtext+= CMD.EOL;
            //AND THEN JUST:
            this.bluetoothSerial.write(printtext).then(success => {
              console.log("Printed successfuly!")
            }, error => {
              console.log("Error!");
            });

And if you find solution for printing qr code pls share :smiley:

Disable buttons inside side menu in ionic

$
0
0

My strategy would be to create a provider/service that exposes an observable specifically a BehaviorSubject

// Imports here
import ....
....

// The initial value of the this observable be an empty string
 highlightState = new BehaviorSubject('');


constructor( private storage: Storage)
{
    this.storage.ready().then(() => {
      this.checkHighlight();
    });
}
// When storage is ready get the stored value and emit it as the next value 
// I've used async here so that I can wait for the stored value to be available
async checkHighlight() {
    return await this.storage.get('highlight')
      .then((res) => {
        if (res === null) {
          // No previously stored highlight
          return;
        } else {
          // Emit the stored value
          this.highlightState.next(res.highlight);
          return;
        }
      });
  }

  getcurrentHighlight(){
    return this.highlightState.value;
  }

Then in your app ts file you could get the value by calling the service in the initialize func but make sure that storage is ready

// This will get the latest value emitted and can be used in your menus

this.highlight = this.myHighligtService.getcurrentHighlight();

this.pages = [
  {
    title: "menu",
    component: MenuPage,
    src: "assets/imgs/grid.png",
    color:
      this.highlight === "menu" ? "danger" : "light",
    class:
      this.highlight === "menu"
        ? "item-md-danger"
        : "",
    isEnabled: true,
  },
   ......
 ]

The reason I would use such a strategy is so that I can monitor the highlight incase a change of its status is initiated by any other page the user is visiting, this means any other page watching highlight will get the new status.

Multiple times tab clicks app gets hang

$
0
0

hi anyone know the solution for this my app get hang when i click multiple times different tabs how to fix this issue i am using ionic 4 for android device

Set page in cache

$
0
0

How to set page in cache in Ionic 4?

Integration of ionicframework with WooCommerce

$
0
0

Hi, I am Zubair, a woocommerce writer from Codup.co, Actually, on cod, we are covering woocommerce related blogs to educate our visitors, So I am completing my blog about the integration of ionicframework with woocommerce. Can anyone in this community help me out about this topic?

Thanks in advance


How to link ngModel value to an object property

$
0
0

I have a generated input list with some data that changes to each user, the data comes as an object and the list is created from the properties of this object. Since this data changes to each user, I can never know the quantity of properties neither the name of the properties. In this input list the user can change the value of the properties and then it should return it as a new object named returnValues.

My problem is that the values are never returned, the object returned is always empty.

html

<ion-content>
	<ion-list *ngFor="let key of objectKeys(properties)">
		<ion-item>
		  	<ion-label position="stacked">{{key}}</ion-label>
		  	<ion-input type="text" [(ngModel)]="returnValues.key" [ngModelOptions]="{standalone: true}">{{properties[key]}}</ion-input>
		</ion-item>
	</ion-list>	
</ion-content>

...

<ion-button (click)="save()">Save</ion-button>

ts

private objectKeys = Object.keys;
private returnValues: Object = {};

...

save() {
	console.log(this.returnValues);
}

  • I tried to put the returned object in the constructor, as suggested here, but to no avail.
  • I tried to create know empty properties to know input objects to check if they are changed, but they are also not.
  • I thought about using forms, but from the documentation I saw that it is necessary to assign names to each input, which I can’t.

Changing the default icon size for size="small" via CSS

$
0
0

I’m trying to set the default size like this

ion-icon {
	font-size: 48px;
    &[size="small"] {
       font-size: 20px
    }
}

I supposed this isn’t the right way to do it. Can anyone point me in the right direction?

Trying to use existing SQLite DB in new Ionic project

$
0
0

HI,

I’m very new to Ionic and Angular so please forgive my noob question, but i’m trying to just open an SQLite database that i already have from my existing iOS and Android apps that i’ve written natively (now looking to use just 1 code base)
In my existing apps, i check to see if the DB exists and if it does i’ll just use that, if it doesn’t then i can download an updated version (if required) or copy it from the app bundle.
In Ionic it seems that i have to create a DB and import everything into it from my existing DB - Thats fine i can do that to, but when i next launch the app it copies everything back into the new DB instead of just using the existing data.

Can anyone shed any light on how i can do this. I’ve also tried to change the loaction of the new DB but i seem to only be able to use ‘deafult’…

My code is below & i’m only testing on an actual device (no web browser)
Any suggestions or pointers would be great!!
Thank you.

import { Platform } from '@ionic/angular';
import { Injectable } from '@angular/core';
import { SQLitePorter } from '@ionic-native/sqlite-porter/ngx';
import { HttpClient } from '@angular/common/http';
import { SQLite, SQLiteObject } from '@ionic-native/sqlite/ngx';
import { BehaviorSubject, Observable } from 'rxjs';
import { File } from '@ionic-native/file/ngx';
import { LoadingController } from '@ionic/angular';

export interface Dev {
  id: number,
  name: string,
  fav: string
}

@Injectable({
  providedIn: 'root'
})




export class DatabaseService {
  private database: SQLiteObject;
  private dbReady: BehaviorSubject<boolean> = new BehaviorSubject(false);
 
  readonly database_name: string = 'developers23.db';

  developers = new BehaviorSubject([]);
  products = new BehaviorSubject([]);
 
  constructor(
    private platform: Platform, 
    private sqlitePorter: SQLitePorter, 
    private sqlite: SQLite, 
    private http: HttpClient,
    private file: File,
    public loadingController: LoadingController
    ) {
    this.platform.ready().then(() => {
      console.log('Platform Ready!');
      this.checkDBExists();
      // this.createDB();
    }).catch(error => {
      console.log(error);
    })
  }

  checkDBExists() {
    this.file.checkFile('default', 'developers23.db')
    .then(this.loadDevelopers)
    .catch(this.createDB);
  }
  
  createDB() {
    console.log('DB Create1');
    this.sqlite.create({
      name: this.database_name,
      location: 'default'
    })
      .then((db: SQLiteObject) => {
        this.database = db;
        this.seedDatabase();
      })
      .catch(e => {
        alert("error " + JSON.stringify(e))
      });
  }

  seedDatabase() {
    console.log('Seed database');
    this.http.get('assets/seed3.sql', { responseType: 'text'})
    .subscribe(sql => {
      console.log('DB Create');
      this.sqlitePorter.importSqlToDb(this.database, sql)
        .then(_ => {
          console.log('DB Create - then');
          this.loadDevelopers();
          this.dbReady.next(true);
        })
        .catch(e => console.error(e));
    });
  }
 
  getDatabaseState() {
    return this.dbReady.asObservable();
  }
 
  getDevs(): Observable<Dev[]> {
    return this.developers.asObservable();
  }

  loadDevelopers() {
    console.log('Getting Manufacturers');
    return this.database.executeSql('SELECT * FROM Lighting_Manufacturers Order By Title COLLATE NOCASE', []).then(data => {
      let developers: Dev[] = [];
      console.log(data);
      console.log('Getting Manufacturers');
      if (data.rows.length > 0) {
        for (var i = 0; i < data.rows.length; i++) {
          developers.push({ 
            id: data.rows.item(i)._id,
            name: data.rows.item(i).Title,  
            fav: data.rows.item(i).fav
           });
        }
      }
      this.developers.next(developers);
    });
  }
 

Changing the default icon size for size="small" via CSS

$
0
0

i would recommend to create a own css class and use this :thinking:

Ionic native datepicker does not show dates

$
0
0

Hi all,

I am using ionic native datepicker since ages in my app and did not change anything the last two years. But now in a new ios-build of my app, suddenly the datepicker does not show the valid dates. I have set minDate and maxDate, the dates out of this range are light-gray as usual, but the valid ones are, to be precise, white on white background. Anyone experienced this before?

Thanks
Alex

Viewing all 231638 articles
Browse latest View live


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