Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 48980 articles
Browse latest View live

Cordova Build Error: Metadata Version Mismatch

$
0
0

@kennyalmendral wrote:

Hello guys, everytime I run ionic cordova build android --release --prod, I get the following error:

Error: Metadata version mismatch for module
C:/Users/Kenny/Projects/CBSTC/User/node_modules/@ionic-native/google-maps/index.d.ts, found version 4, expected 3

Anyone else experienced it before? Thanks in advance…

Here’s my ionic info by the way:

[WARN] Detected locally installed Ionic CLI, but it's too old--using global CLI.

Ionic:

   ionic (Ionic CLI)  : 4.10.2 (C:\Users\Kenny\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework    : ionic-angular 3.9.3
   @ionic/app-scripts : 2.1.4

Cordova:

   cordova (Cordova CLI) : 6.5.0
   Cordova Platforms     : android 6.1.2
   Cordova Plugins       : cordova-plugin-ionic-webview 1.2.1, (and 21 other plugins)

System:

   NodeJS : v10.15.1 (C:\Program Files\nodejs\node.exe)
   npm    : 2.15.12
   OS     : Windows 10

and my package.json dependencies:

"dependencies": {
    "@angular/common": "4.1.3",
    "@angular/compiler": "4.1.3",
    "@angular/compiler-cli": "4.1.3",
    "@angular/core": "4.1.3",
    "@angular/forms": "4.1.3",
    "@angular/http": "4.1.3",
    "@angular/platform-browser": "4.1.3",
    "@angular/platform-browser-dynamic": "4.1.3",
    "@ionic-native/background-mode": "^4.9.1",
    "@ionic-native/browser-tab": "^4.9.1",
    "@ionic-native/call-number": "^4.9.1",
    "@ionic-native/camera": "^3.14.0",
    "@ionic-native/core": "^3.14.0",
    "@ionic-native/diagnostic": "^3.14.0",
    "@ionic-native/firebase": "^4.9.1",
    "@ionic-native/google-maps": "^4.2.1",
    "@ionic-native/http": "^3.14.0",
    "@ionic-native/in-app-browser": "^4.9.1",
    "@ionic-native/location-accuracy": "^3.14.0",
    "@ionic-native/onesignal": "^4.9.1",
    "@ionic-native/paypal": "^4.9.1",
    "@ionic-native/social-sharing": "^4.9.1",
    "@ionic-native/splash-screen": "3.12.1",
    "@ionic-native/status-bar": "3.12.1",
    "@ionic-native/stripe": "^4.9.1",
    "@ionic-native/vibration": "^4.9.1",
    "@ionic/storage": "2.0.1",
    "angular": "^1.7.2",
    "body-parser": "^1.18.3",
    "browser-sync": "^2.24.7",
    "call-number": "git+https://github.com/Rohfosho/CordovaCallNumberPlugin.git",
    "cheerio": "^0.19.0",
    "cordova-browser": "^5.0.4",
    "cordova-custom-config": "git+https://github.com/dpa99c/cordova-custom-config.git",
    "cordova-ios": "4.5.4",
    "cordova-plugin-accountkit": "^1.4.0",
    "cordova-plugin-advanced-http": "^2.0.1",
    "cordova-plugin-background-mode": "^0.7.2",
    "cordova-plugin-browsertab": "^0.2.0",
    "cordova-plugin-buildinfo": "^1.1.0",
    "cordova-plugin-camera": "^3.0.0",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-device": "^1.1.7",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-googlemaps": "^2.4.4",
    "cordova-plugin-inappbrowser": "^1.7.2",
    "cordova-plugin-ionic-webview": "^1.2.1",
    "cordova-plugin-ionic-wkkeyboard": "^1.1.15",
    "cordova-plugin-paystack": "git+https://github.com/blinks32/cordova-paystack-plugin-updated.git",
    "cordova-plugin-request-location-accuracy": "^2.2.3",
    "cordova-plugin-splashscreen": "^4.1.0",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-vibration": "^2.1.6",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-plugin-x-socialsharing": "^5.4.1",
    "cordova.plugins.diagnostic": "^4.0.10",
    "cors": "^2.8.4",
    "csp-parse": "0.0.2",
    "elementtree": "^0.1.7",
    "es6-promise-plugin": "^4.2.2",
    "express": "^4.16.3",
    "glob": "^5.0.15",
    "ionic-angular": "^3.9.2",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionic2-rating": "^1.2.2",
    "ionicons": "3.0.0",
    "make-dir": "^1.3.0",
    "minimist": "^1.2.0",
    "mx.ferreyra.callnumber": "0.0.2",
    "npm": "^2.15.12",
    "onesignal-cordova-plugin": "^2.4.4",
    "plist": "^1.2.0",
    "promise-polyfill": "6.0.2",
    "q": "^1.5.1",
    "rxjs": "5.4.0",
    "stripe": "^5.10.0",
    "sw-toolbox": "3.6.0",
    "xml2js": "^0.4.19",
    "zone.js": "0.8.12"
  },

Posts: 1

Participants: 1

Read full topic


How to show Wordpress post embed video in my app

$
0
0

@flycoders_sourav wrote:

How to show Wordpress post embed video in my app when i tried to show my response like this
<div [innerHTML]='selectedItem.content.rendered'></div>

only showing content but video not showing

please help me out.
Thanks in advance

Posts: 1

Participants: 1

Read full topic

Access to XMLHttpRequest at from origin 'http://localhost' has been blocked by CORS policy Ionic 4

$
0
0

@sridharan31 wrote:

Ionic 4 project HTTP request I got an error

Access to XMLHttpRequest at ‘https://u*****test.f****t.co.in/getMccList’ from origin ‘http://localhost’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.

I have added plugin cordova-plugin-whitelist

added chrome extension i run this app in android device and debug i chrome browser

this is my server HTTP request call

callserver(methodname, metadata, metainfo){
    var TIMEOUT_REQUEST =10;

  var request = {
    "MetaData": metadata,
    "MetaInfo": metainfo
  };
  const httpOptions = {headers: new HttpHeaders({'Content-Type': 'application/json'})};

  return this.http.post(this.URL+methodname,request,httpOptions).pipe(
    catchError(this.handleError)
  );
  }

Posts: 1

Participants: 1

Read full topic

Ionic3 vs ioni4

$
0
0

@rajputsachin wrote:

i create an app in ionic 3 and i feel like i am stupid to choose ionic.
if i upgrade cli to ionic4 then ionic3 code is not working and i use ionic3 then sometimes it is giving problem like cmd stucked.
and all the people who code in ionic3 are fool if they update code in ionic4.

Posts: 1

Participants: 1

Read full topic

Ionic 4 value="" attribute not returning any data

$
0
0

@emtechict wrote:

I have a profile Edit form where am passing user details from an api into using the html value="{{a.firstname}}". when i click on submit button am getting “undefined” for all the fields.

please help.

bellow is the form:

<form [formGroup]=“updateForm” (ngSubmit)=“saveForm(updateForm.value)”>

<div *ngFor=“let d of profile”>

<div align=“center” style=“background-color: #3880ff; padding: 50px; color: white;”>

<!-- <ion-icon name=“add” style=“padding: 30px; border-radius: 100px; background-color: white; color: #3880ff;”></ion-icon>–>

<h6><b>Change Profile Image</b></h6>

</div>

<ion-list-header color=“primary”><h4><b>Edit Information</b></h4></ion-list-header>

<ion-item>

<ion-label position=“floating”>First Name</ion-label>

<ion-input type=“text” formControlName=“firstname” value="{{d.firstname}}"></ion-input>

<div class=“error-box” ngIf=“firstnameRequired”> firstname is required!</div>

<div class=“error-box” ngIf=“firstnameValid”> Valid firstname is required!</div>

</ion-item>

<ion-item>

<ion-label position=“floating”>Last Name</ion-label>

<ion-input type=“text” formControlName=“lastname” clearInput value="{{d.lastname}}"></ion-input>

<div class=“error-box” ngIf=“lastnameRequired”> lastname is required!</div>

<div class=“error-box” ngIf=“lastnameValid”> Valid lastname is required!</div>

</ion-item>

<ion-item>

<ion-label position=“floating”>E-Mail</ion-label>

<ion-input type=“email” formControlName=“email” clearInput value="{{d.email}}"></ion-input>

<div class=“error-box” ngIf=“emailRequired”> Email ID is required!</div>

<div class=“error-box” ngIf=“emailValid”> Valid Email ID is required!</div>

</ion-item>

<ion-item>

<ion-label position=“floating”>Phone</ion-label>

<ion-input type=“number"formControlName=“phone” clearInput value=”{{d.phone}}"></ion-input>

</ion-item>

<ion-item>

<ion-label position=“floating”>Country</ion-label>

<ion-select formControlName=“country” clearInput placeholder="–select country–" >

<ion-select-option *ngFor=“let c of items” value="{{c.id}}">{{c.name}}</ion-select-option>

</ion-select>

</ion-item>

<ion-item>

<ion-label position=“floating”>About</ion-label>

<ion-input type=“text” formControlName=“about” clearInput value="{{d.about}}"></ion-input>

</ion-item>

<ion-button color=“primary” type=“submit” expand=“full” >Save Changes</ion-button>

</div>

</form>

Posts: 2

Participants: 2

Read full topic

Diagnostic not working

$
0
0

@theetje wrote:

Hi all,

I am working on an app and would like to check if Bluetooth is on before trying to collect data. Now I tried using the ionic diagnostic plugin as given here. And added the usual this to the app.module.ts:

import { Diagnostic } from '@ionic-native/diagnostic/ngx';
...
providers: [
...
        Diagnostic,
    ]
...

The plugin is installed and shows after running the ionic cordova list command. But in-app it keeps on running into the Uncaught (in promise): TypeError: object is not a function TypeError: object is not a function at Diagnostic.BluetoothAvailable

I am calling the following function from a provider in a different provider:

import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { Diagnostic } from '@ionic-native/diagnostic/ngx';
import { Platform } from 'ionic-angular';

/*
  Generated class for the DiagnosticProvider provider.

  See https://angular.io/guide/dependency-injection for more info on providers
  and Angular DI.
*/
@Injectable()
export class DiagnosticProvider {

    constructor(
        public http: HttpClient,
        private diagnostic: Diagnostic,
        private platform: Platform,
    ) {
            console.log('Hello DiagnosticProvider Provider');
    }
 
    public checkBluetooth() {
        console.log("in checkBluetooth");
        this.platform.ready().then(() =>{
            let successCallback = (isAvailable) => { console.log('Is available? ' + isAvailable); }
            let errorCallback = (e) => console.error(e);
            console.log("works");
            this.diagnostic.isBluetoothAvailable().then(successCallback).catch(errorCallback);
        });
    }
}


Ionic:

   ionic (Ionic CLI)  : 4.10.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.1.10

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 1.2.1, (and 9 other plugins)

System:

   Android SDK Tools : 26.1.1 (/home/thomas/Android/Sdk)
   NodeJS            : v8.11.4 (/usr/bin/node)
   npm               : 5.8.0
   OS                : Linux 4.18

Also, I tried ionic repair and removing all node_modules and reinstalling them.

Any ideas on how to tackle this

Posts: 1

Participants: 1

Read full topic

How to set ion-searchbar placeholder dynamically

$
0
0

@DavidvZ wrote:

I would like to have a generic search bar component but can’t figure out how to set the placeholder through binding or interpolation. Is this possible and if so how?

Found this -

Doesnt seem to work.

placeholder={{myVar}}
[placeholder]="myVar"

Also no luck.

I might have missed something simple but Ive looked around and cant figure it out.

Ionic:

   ionic (Ionic CLI)             : 4.10.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.1
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.4.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 7.1.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 4 other plugins)

System:

   NodeJS : v10.15.1 (/usr/local/bin/node)
   npm    : 6.8.0
   OS     : macOS Mojave
   Xcode  : Xcode 10.1 Build version 10B61

Posts: 1

Participants: 1

Read full topic

When to use ionViewWillEnter, ionViewDidEnter, ionViewDidLeave, ionViewWillLeave?


Push Notification for Android and iOS

$
0
0

@Nirmalya-S wrote:

I have an app with a user base of almost 80,000.

  1. Is there any free push notification plugin??
  2. Is Ionic push notification will work if the app is close?

Need suggestion…!

Thanks.

Posts: 3

Participants: 2

Read full topic

Display image content as Base64 string?

$
0
0

@anta40 wrote:

Hi, this is my first time learning Ionic. I want to take picture, then convert it Base64 string so it can be sent via HTTP POST. Here’s my code:

import { Component } from '@angular/core';
import { Camera, CameraOptions } from '@ionic-native/camera/ngx';
import { Dialogs } from '@ionic-native/dialogs/ngx';
import { File, FileEntry } from '@ionic-native/File/ngx';
import { FilePath } from '@ionic-native/file-path/ngx';
import { WebView } from '@ionic-native/ionic-webview/ngx';
import { Base64 } from '@ionic-native/base64/ngx';

@Component({
  selector: 'app-tab1',
  templateUrl: 'tab1.page.html',
  styleUrls: ['tab1.page.scss']
})

export class Tab1Page {

  constructor(private base64: Base64, private camera: Camera, private dialogs:Dialogs, private file:File, private filePath: FilePath, private webview:WebView) { }

  takePicture(){
    const options: CameraOptions = {
      quality: 50,
      destinationType: this.camera.DestinationType.FILE_URI,
      encodingType: this.camera.EncodingType.JPEG,
      mediaType: this.camera.MediaType.PICTURE
    }
  
    this.camera.getPicture(options).then((imageData) => {

    this.base64.encodeFile(imageData).then((base64File: string) => {
      this.dialogs.alert(base64File)
    .then(() => console.log('Dialog dismissed'))
    .catch(e => console.log('Error displaying dialog', e));
    }, (err) => {
      console.log(err);
    });
    }, (err) => {
      console.log(err);
    });
  }
}

I don’t see any alert displaying the Base64 value of the image What’s wrong here?

Posts: 1

Participants: 1

Read full topic

YouTube is not playing inside the video tag

$
0
0

@flycoders_sourav wrote:

Below my code am tired like this . please help me out

<video width="100%" height="100%" controlsList="nodownload" controls autoplay> 
      <source src="https://www.youtube.com/watch?v=modDjwFWqxE"  type="video/mp4" >
 </video>

Thanks in advance

Posts: 1

Participants: 1

Read full topic

Cordova-plugin-firebase how to remove crashlytics?

$
0
0

@reedrichards wrote:

I have installed cordova-plugin-firebase in an Ionic Cordova application and since I have added this plugin I notice the following error when I debug my app with Xcode

[Fabric] failed to download settings Error Domain=FABNetworkError Code=-5 “(null)” UserInfo={status_code=403, type=2, request_id=…, content_type=application/json; charset=utf-8}

I don’t want to use Fabric/crashlytics in any case

How could I remove it without affecting the Cordova Firebase plugin?

P.S.: Copy of the unanswered question I opened on Stackoverflow https://stackoverflow.com/questions/54767802/cordova-plugin-firebase-how-to-remove-crashlytics

Posts: 1

Participants: 1

Read full topic

Custom scss-file with variable not working?

$
0
0

@xs2bas wrote:

Why isn’t this working?
Using Ionic 4, applied in a custom scss-file.

$somecolor: #00ff00;
ion-content {
  --ion-background-color: $somecolor; // not working, background turns white
//  --ion-background-color: #00ff00; // working, background turns green
}

Posts: 1

Participants: 1

Read full topic

Index.html file was not found error in ios using xcode?

$
0
0

@karthikaivel wrote:

Hi,
I have one v3 ios application when add platform that time was successfully added platform.then i opened application in xcode and run simulator or our iPhone will show index.html file was not found repeatedly but that file available inside of folder.what can i do?how do remove that error.
give me a solution.
os: mac
software: xcode
platform: ionic v3.

Posts: 1

Participants: 1

Read full topic

Could not find com.google.android.gms:play-services-map:15.0.1

$
0
0

@ahmedelhadi7 wrote:

I want to build my App which contains google maps plugin but this error show up (>could not find com.google.android.gms:play-services-map:15.0.1),
I am sure that google repository Updated to the latest version which is (11.0.4).

I already knew that I should add google() to repositories , done but same error again.

When I tried to downgrade version in( app/ build.gradle ) I got another many damaged in building process .
I need help, please .

Posts: 1

Participants: 1

Read full topic


How to build and launch one ionic v3 application in xcode 10.0?

$
0
0

@karthikaivel wrote:

Hi,
I have one v3 application.how to build and app launch in app-store using xcode 10.0?
Any one know solution please solve me.
Thank you!.

Posts: 1

Participants: 1

Read full topic

How could I find iOS app and how to sign it?

$
0
0

@Manel00 wrote:

Hi everyone!

I’m trying to find the iOS build app but don’t know where is it, then I think I need to sign it, how should I do that? I can run it on simulator on Xcode but cannot find the app…

Thank you so much

Regards

Posts: 1

Participants: 1

Read full topic

Ionic 3 - delete users when app uninstalled

$
0
0

@mrg250 wrote:

Hello,
I have an app that uses firebase and there I manage my users’ data.
The user is created by using phone auth, and the session is cached in the users’ phone
The problem I have is, that whenever the user deletes the app, the cache is deleted but the user profile in the database isn’t.

How can I solve this?

Posts: 1

Participants: 1

Read full topic

Ionic and Native Bluetooth Serial Plugin

$
0
0

@planika wrote:

Hello!
I have with bluetooth serial plugin: https://ionicframework.com/docs/native/bluetooth-serial/

When I create a project like: ionic start App --type=“ionic-angular” - and add plugin i have error like:Object(…) is not a function
at BluetoothSerial.isEnabled

But when I create a project like: ionic start App - plugin works correctly.

What is the different? How can I solve problem with “object is not a function” in this case?

Please help!,

Marcin

Posts: 1

Participants: 1

Read full topic

How to add sub menu in the side menu in Ionic 4?

$
0
0

@Fearcoder wrote:

I am migrating my ionic 3 app to ionic 4. In Ionic 3 I had a sub menu in a category. This is my old code:

Ionic 3 submenu

Typescript

menuItemForce(): void {
    this.showForce = !this.showForce;
  } 

This function will shown the sub items when clicked on a category.

This is the code to show the sub menu:

<ion-list class="sidenav">
            <ion-item (click)="menuItemForce()">
                <ion-icon name="walk" color="primary"></ion-icon>
                Force
            </ion-item>
            <ion-item-group submenu [class.visible]="showForce">
                <ion-item submenu-item menuClose (click)="openWorkPage()">Test1</ion-item>
                <ion-item submenu-item menuClose (click)="openCirckelPage()">Test2</ion-item>
                <ion-item submenu-item menuClose (click)="openDistancePage()">Test3</ion-item>
                <ion-item submenu-item menuClose (click)="openSpeedPage()">Test4</ion-item>
                <ion-item submenu-item menuClose (click)="openKinEnergyPage()">Test5</ion-item>
                <ion-item submenu-item menuClose (click)="openTimePage()">Test6</ion-item>
                <ion-item submenu-item menuClose (click)="openGrafityEnergyPage()">Test7</ion-item>
                <ion-item submenu-item menuClose (click)="openGrafityForcePage()">Test8</ion-item>
            </ion-item-group>
        </ion-list>

When I click the other pages will shown in the menu. This was working good.

This is my code in Ionic 4

Ionic 4 menu

<ion-app>
  <ion-menu contentId="content" side="start">
    <ion-header>
      <ion-toolbar>
        <ion-title>Categorie</ion-title>
      </ion-toolbar>
    </ion-header>
    <ion-content>
      <ion-list>
        <ion-menu-toggle auto-hide="false" *ngFor="let p of appPages">
          <ion-item [routerDirection]="'root'" [routerLink]="[p.url]">
            <ion-icon slot="start" [name]="p.icon"></ion-icon>
            <ion-label>
              {{p.title}}
            </ion-label>
          </ion-item>
        </ion-menu-toggle>
      </ion-list>
    </ion-content>
  </ion-menu>
  <ion-router-outlet id="content" main></ion-router-outlet>
</ion-app>

Its working good but I don’t know how I can add the sub menu in ionic 4.

How can I have the same functions for the sub menu in Ionic 4?

Posts: 1

Participants: 1

Read full topic

Viewing all 48980 articles
Browse latest View live


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