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

Ionic 3 Local Storage

$
0
0

@pendora7 wrote:

Hey I am making a Survey Application in which Surveyee’s Data is stored in Local Database(when in offline mode) and when internet is available it sends all data to MySql Database.
What Local storage should i use ? What should be my approach ?
Thank You

Posts: 1

Participants: 1

Read full topic


Background running in geofence

$
0
0

@Faizyfaazz wrote:

I used Geo fence to make a proximity application.but its work only when i open the app. how to set this app in background run.i want to check the condition in every 15 seconds. pleas help me.


private addGeofence() {
    //options describing geofence
    let fence = {
      id: '69ca1b88-6fbe-4e80-a4d4-faizy4d3748acdb', //any unique ID
      latitude:       8.556498, //center of geofence radius
      longitude:      76.881820,
      radius:         100, //radius to edge of geofence in meters
      transitionType: 1, //see 'Transition Types' below
      notification: { //notification settings
        id:             121212122, //any unique ID
        title:          'You crossed a fence', //notification title
        text:           'You just arrived to white oval technology.', //notification body
        openAppOnClick: true //open app when notification is tapped
      }
    }

Posts: 1

Participants: 1

Read full topic

Unable to install unsigned apk

$
0
0

@vkr1980 wrote:

I have create an unsigned apk using "ionic cordova build android --prod --release"
but not able to install it in the device while installing it shows app not installed
Please help ?

Posts: 1

Participants: 1

Read full topic

Unexpected close tag error, but cannot locate the file that didn't close the tag

$
0
0

@batur wrote:

I use “ionic serve”, my app runs well, but when I build the app, run command “cordova build android”, it has the error below

No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform android
Checking config.xml for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in android platform
No differences found between plugins added to project and installed in android platform. Continuing...
Generating platform-specific config.xml from defaults for android at /Users/batur/Project/javascript/ionic/myApp/platforms/android/res/xml/config.xml
Error: Unexpected close tag
Line: 15
Column: 15
Char: >

I checked the all config.xml file, it looks fine. Did anyone have similar error?
my “ionic info” is below

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

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.0.1
    Cordova Platforms  : android 6.3.0 ios 4.5.2
    Ionic Framework    : ionic-angular 3.8.0

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2
    Node              : v8.6.0
    npm               : 4.6.1
    OS                : macOS Sierra
    Xcode             : Xcode 9.0.1 Build version 9A1004

Posts: 1

Participants: 1

Read full topic

Installing Call Number Plugin Problem

$
0
0

@Michea wrote:

Hi, this is my first time that I install a plugin, so i have installed this plugin just like official page say:

1) $ ionic cordova plugin add call-number
2) $ npm install --save @ionic-native/call-number

first line install ok, but 2) line show this:

My question is if I should worry? or it will works anyway?

Mi ionic info:

@ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0
global packages:
    cordova (Cordova CLI) : 7.0.1
local packages:
    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.6.1
System:
    Node : v6.11.3
    npm  : 3.10.10
    OS   : Windows 10
Environment Variables:
    ANDROID_HOME : not set
Misc:
    backend : legacy

And my package.json:

{
    "name": "crist",
    "version": "0.0.1",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "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/core": "3.12.1",
        "@ionic-native/splash-screen": "3.12.1",
        "@ionic-native/status-bar": "3.12.1",
        "@ionic/storage": "2.0.1",
        "angular-linky": "^1.2.2",
        "angular2-moment": "^1.7.0",
        "cordova-android": "^6.2.3",
        "cordova-ios": "^4.4.0",
        "cordova-plugin-console": "^1.0.5",
        "cordova-plugin-device": "^1.1.4",
        "cordova-plugin-splashscreen": "^4.0.3",
        "cordova-plugin-statusbar": "^2.2.2",
        "cordova-plugin-whitelist": "^1.3.1",
        "ionic-angular": "3.6.1",
        "ionic-plugin-keyboard": "^2.2.1",
        "ionicons": "3.0.0",
        "rxjs": "5.4.0",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.12"
    },
    "devDependencies": {
        "@ionic/app-scripts": "2.1.4",
        "typescript": "2.3.4"
    },
    "description": "An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {}
        },
        "platforms": [
            "android"
        ]
    }
}

Posts: 1

Participants: 1

Read full topic

Unlimited level list for Menu

$
0
0

@aditya_1027 wrote:

I want to create a menu in sidebar. In which we will have unlimited level of subcategories. Please guide me if anyone know how can i do this in ionic 3.

This is my code and i want to change it to unlimited level subcategories;

    <ion-list>
      <ion-item menuClose *ngFor="let p of categories; let i = index" (click)="openPage(p)">
        {{p.name}}
        <ion-icon *ngIf="p.subcategories.length" name="ios-arrow-forward" item-end></ion-icon>
        <div *ngIf="p.subcategories.length">
          <ion-item *ngFor="let s of p.subcategories">
            {{s.name}}
            <ion-icon *ngIf="p.subcategories.length" name="ios-arrow-forward" item-end></ion-icon>
          </ion-item>
        </div>
      </ion-item>
    </ion-list>```

Posts: 1

Participants: 1

Read full topic

Write text into a bar element? (Chart.js)

$
0
0

@dram3vlh wrote:

Hi, i made a stacked bar chart and i want to write some info in every stack.How can i write?

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import * as ChartJs from 'chart.js';

@Component({
  selector: 'page-graph',
  templateUrl: 'graph.html'
})
export class GraphPage {
  chartOptions: any
  constructor(public navCtrl: NavController) {


  }
  public barChartOptions:any = {
		scaleShowVerticalLines: false,
		responsive: true,
  };

  ionViewDidEnter() {
    var canvas = <HTMLCanvasElement> document.getElementById("myChart");
	var ctx = canvas.getContext("2d");

/*	ctx.font = '48px serif';
	ctx.textAlign = 'left';
	ctx.strokeText('Hello', 0, 100);*/

	ChartJs.defaults.global.legend.display = false;
	ChartJs.defaults.global.tooltips.enabled = false;
	 ChartJs.Bar(ctx,{
      type: 'line',
      data: {

  labels: ["Gün 1", "Gün 2", "Gün 3","Gün 4","Gün 5","Gün 6","Gün 7"],
			datasets: [


				{
			  	label: "Kahvaltı",
			  	backgroundColor: "rgba(220, 255, 46, 0)",
			  	data: [0, 0, 0,0, 0, 0,0],
				  stack: 'Stack 1',
				},
			 {
			  	label: "Öncesi",
			  	backgroundColor: "rgba(99,255,132,0.2)",
			  	data: [10, 10, 10,10, 10, 10,10],
				  stack: 'Stack 1',


			  },
			  {
			  	label: "Karb Miktarı",
			  	backgroundColor: "rgba(99,132,255,0.2)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
			  },
			  {
			  	label: "İnsülin",
			  	backgroundColor: "rgba(255,99,132,0.2)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
				},
				{
			  	label: "Sonrası",
			  	backgroundColor: "rgba(220, 255, 46, 0.53)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
			  },
				{
			  	label: "Öğlen",
			  	backgroundColor: "rgba(220, 255, 46, 0)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
				},
				{
			  	label: "Öncesi",
			  	backgroundColor: "rgba(99,255,132,0.2)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
			  },
			  {
			  	label: "Karb Miktarı",
			  	backgroundColor: "rgba(99,132,255,0.2)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
			  },
			  {
			  	label: "İnsülin",
			  	backgroundColor: "rgba(255,99,132,0.2)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
				},
				{
			  	label: "Sonrası",
			  	backgroundColor: "rgba(220, 255, 46, 0.53)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
			  },
				{
			  	label: "Akşam",
			  	backgroundColor: "rgba(220, 255, 46, 0)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
				},
				{
			  	label: "Öncesi",
			  	backgroundColor: "rgba(99,255,132,0.2)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
			  },
			  {
			  	label: "Karb Miktarı",
			  	backgroundColor: "rgba(99,132,255,0.2)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
			  },
			  {
			  	label: "İnsülin",
			  	backgroundColor: "rgba(255,99,132,0.2)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
				},
				{
			  	label: "Sonrası",
			  	backgroundColor: "rgba(220, 255, 46, 0.53)",
			  	data: [10, 10, 10,10, 10, 10,10],
			  	stack: 'Stack 1'
			  },
			]

	  },


      options: {
				scales: {
					yAxes: [{
						title:{
							text: 'KAHVALTI,ÖĞLEN, AKŞAM',

						},
						tooltip: {
							enabled: false,
						},
						ticks: {
							max: 150,
						},
						stacked: true,
					}]
				}
			}
		});
    }
}

Posts: 1

Participants: 1

Read full topic

Problems with logout in ionic 3

$
0
0

@Kabilesh wrote:

I am new to ionic app development. I have Implemented the login and logout logic like below.

Login in login.ts

loginUser(){
    if (!this.loginForm.valid){
      console.log(this.loginForm.value);
    } else {
      this.authData.loginUser(this.loginForm.value.email, this.loginForm.value.password)
      .then( authData => {
        this.navCtrl.setRoot(TabsPage);
      }, error => {
        this.loading.dismiss().then( () => {
          let alert = this.alertCtrl.create({
            message: error.message,
            buttons: [
              {
                text: "Ok",
                role: 'cancel'
              }
            ]
          });
          alert.present();
        });
      });

      this.loading = this.loadingCtrl.create({
        dismissOnPageChange: true,
      });
      this.loading.present();
    }
  }



Logout in home.ts

logout(){
     this.authData.logoutUser()
    .then((user) => {
      let alert = this.alertCtrl.create({
        message: "You are logging out",
        buttons: [
          {
            text: "Ok",
            role: 'cancel',
            handler: () => {
              this.navCtrl.setRoot(LoginPage);
              this.navCtrl.popToRoot();
            }
          }
        ]
      });
      alert.present();
    }, (error) => {
      var errorMessage: string = error.message;
      let errorAlert = this.alertCtrl.create({
        message: errorMessage,
        buttons: [
          {
            text: "Ok",
            role: 'cancel'
          }
        ]
      });
      errorAlert.present();
    });
  }
The firebase authentication works properly. The issue here is when logging in I am setting the TabsPage as the root.
Then in logout
      this.navCtrl.setRoot(LoginPage);
          this.navCtrl.popToRoot();
**After logout the login page appears and the tabs are also appearing in the LoginPage. How can I solve this?**

Posts: 1

Participants: 1

Read full topic


Fingerprint authentication in real world

$
0
0

@Dlazzy wrote:

Hello,

I’m trying to find a way to use a fingerprint authentication in real world.
All examples I’m seeing over internet it’s just using fingerprint to access another page…

To do all tests I’m using plugin https://ionicframework.com/docs/native/fingerprint-aio/ , it works great but I was a little but disappointed about something :
When the phone successfully recognize my finger, the plugin return a sort of ID, for example : x7D6…
If tap again on the authentication button and use same finger, plugin return another ID : a8c4…

So my first goal to save the first saved ID in a DB and reuse it later to authenticate an user cannot work…
Now, if it’s possible, I need to :

User open app, login with regular nickname and password, if phone is compatible, ask user if he want to use fingerprint. If user accept, app ask to verify fingerprint, user do it, it’s a success and plugin return the ID. The ID is saved and linked to his account.
User decide to disconnect from his account. And this time he choose fingerprint authentication, app ask him to verify fingerprint, user do, it’s success, and plugin return the ID, if ID is link to an account (his own), connect him to his account.

It is possible to do something like this, or it’s unsecure ?
Another way to do this ?

Thanks for your help, because now I don’t know what’s the interest of using fingerprint authentication in a real app ?

Posts: 1

Participants: 1

Read full topic

Display to the image which has taken from camera iOS problem

$
0
0

@inartech wrote:

Goodmorning guys… I use this code in .ts file to take a picture:

this.camera.getPicture()
.then((imageData) => {
this.picture = imageData;
this.tookPicture = true;
})

I use this code in .html file to display the taken image:

This works on Android, but does not on iOS. Do you have any solution??

Posts: 1

Participants: 1

Read full topic

Get vales from Ion-checkbox

$
0
0

@pendora7 wrote:

Hey ! I have a JSON URL from which some data is coming, I am getting that data in Checkbox. The problem is that how to get data (values selected) from ion-checkbox ?
Thanks

Posts: 3

Participants: 2

Read full topic

Search bar

$
0
0

@dipankar123 wrote:

hi guys,
facing problem related to search function
showing error when i m typing a value in search bar
ERROR TypeError: data.StudentID.toLowerCase is not a function
please help
here is my code:
html:

<ion-header>
    <ion-navbar hideBackButton>

      <ion-searchbar *ngIf="toggled" [(ngModel)]="searchstudent" [showCancelButton]="true" cancelButtonText="close" (ionCancel)="toggleSearch()"
        (ionInput)="getFilteredItem($event)"></ion-searchbar>

  </ion-navbar>
</ion-header>

and here is my .ts

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, MenuController } from 'ionic-angular';
import { UserTeacherProvider } from '../../providers/user-teacher/user-teacher';
import { Storage } from '@ionic/storage';


@IonicPage()
@Component({
  selector: 'page-t-student-attendence',
  templateUrl: 't-student-attendence.html',
})
export class TStudentAttendencePage {

  teacher: any;
  attendenceList: any;
  items: any;
  toggled: boolean;

  searchstudent= '';

  constructor(public navCtrl: NavController,
    public navParams: NavParams,
    public storage: Storage,
    public teacherProvider: UserTeacherProvider,
    public menuctrl: MenuController) {

    this.menuctrl.swipeEnable(true)
    this.dateWiseAttendance();
    this.toggled = false;
  }


  dateWiseAttendance() {
    console.log('subject clicked');
    this.storage.get('token').then((value) => {
      console.log('subtoken: ' + JSON.parse(value).AuthToken);
      this.teacherProvider.GetDateWiseStudentWiseAttendance(JSON.parse(value).AuthToken).then(data => {
        console.log('list: ' + data)
        this.attendenceList = data;
        this.items = data;
      });
    });
  }

  toggleSearch() {
    this.toggled = this.toggled ? false : true;
  }

  getFilteredItem(searchbar) {
    var item = searchbar.target.value;
    this.attendenceList = this.items.filter((data) => {
      //let myItem = JSON.parse(JSON.stringify(data))
      return (data.StudentID.toLowerCase().indexOf(item.trim().toLowerCase()) > -1);
    });
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad TStudentAttendencePage');
  }

}

Posts: 1

Participants: 1

Read full topic

HTTP Timeout on --release

$
0
0

@fiuza78 wrote:

Hello there,

I have an app that works perfectly fine on chrome, emulator and on my tablet. But if I build it with --release tag, any http request get a timeout error.

works fine: ionic cordova build android --prod

http timeout: ionic cordova build android --prod --release

I’m not sure if this is an android specific configuration on my tablet or some other configuration I’m missing on my app.

Thank you!

Posts: 1

Participants: 1

Read full topic

When click on function showig this erro

$
0
0

@flycoders_sourav wrote:

i’m click on a function for navigation and nearbyPlace() function call into the ionViewWillEnter like this.showing an error.

actually i want to do after click on a button the goring to next page and load the function nearbyPlace and showing near by location into the map.

ionViewWillEnter(){
   this.nearbyPlace();
}

please help me anyone.

Posts: 1

Participants: 1

Read full topic

Field 'browser' doesn't contain a valid alias configuration

$
0
0

@aditya_1027 wrote:

Tried to use --prod with run android command but getting this error:

Module not found: Error: Can't resolve './app.module.ngfactory' in '/Users/Aditya/Desktop/Drive/work/ionic-apps/Tech9Mage/src/app'
resolve './app.module.ngfactory' in '/Users/Aditya/Desktop/Drive/work/ionic-apps/Tech9Mage/src/app'
  using description file: /Users/Aditya/Desktop/Drive/work/ionic-apps/Tech9Mage/package.json (relative path: ./src/app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/Aditya/Desktop/Drive/work/ionic-apps/Tech9Mage/package.json (relative path: ./src/app)
    using description file: /Users/Aditya/Desktop/Drive/work/ionic-apps/Tech9Mage/package.json (relative path: ./src/app/app.module.ngfactory)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/Aditya/Desktop/Drive/work/ionic-apps/Tech9Mage/src/app/app.module.ngfactory doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration```

Posts: 1

Participants: 1

Read full topic


(Ionic CLI) : 3.18.0 generators issue

$
0
0

@vikramvision wrote:

Hi, I started a new project with ionic and i want to generate new page with CLI : ionic generate page Contact but i had a strange tags like that : [ERROR] Generators are only supported in Ionic Angular projects. I tried all the solution which i found on internet. But error is still there. If anyone have any idea about that issue please share. Thank You. Waiting for solution ASAP.

Posts: 2

Participants: 2

Read full topic

Photo taken by camera not showing in tag img in Ionic view

$
0
0

@paoloBittante wrote:

Hi!
I have this problem.
I am taking a photo with the ionic native camera, showing the photo in a tag img in the same page and as last uploading to the server with the file transfer plugin.

All this work perfectly in the device executing ionic cordova run android --device but when I upload the app to ionic pro and using it in the ionic view app:

  • I can’t see the image but only the alt attribute
  • I can’t do the upload with file transfer

This is how it appears when I test in the device with ionic cordova run android --device

I think is something with the path of the image.

Thanks for help!

Posts: 1

Participants: 1

Read full topic

Retrieve nested structured database of firebase

Uploading pictures

$
0
0

@khalilben wrote:

Hi,

I have a form with text input and i want to add picture file and upload it using api laravel…
Any code example ?

I already did this but don’t know if it’s the best way to do

<div [formGroup]="sinistreForm">
    <ion-item>
      <ion-input type="text" placeholder="Nom conducteur" formControlName="iNom" [(ngModel)]="userData.NomConducteur"></ion-input>
    </ion-item>
    <ion-item>
      <ion-input type="number" pattern="[0-9]*" placeholder="Tel conducteur" formControlName="iTel" [(ngModel)]="userData.TelConducteur"></ion-input>
    </ion-item>
    <ion-item>
      <ion-input type="text" placeholder="CIN conducteur" formControlName="iCin" [(ngModel)]="userData.CinConducteur"></ion-input>
    </ion-item>
    <ion-item (click)="getUserPosition()">
      <ion-input type="text" disabled formControlName="iLongitude" value="Longitude : {{lo}}"></ion-input>
    </ion-item>
    <ion-item (click)="getUserPosition()">
      <ion-input type="text" disabled formControlName="iLatitude" value="Latitude : {{la}}"></ion-input>
    </ion-item>
    <ion-item>
      <ion-input type="file"  formControlName="iJustif1" [(ngModel)]="justif1"></ion-input>
    </ion-item>

    <br>

    <button ion-button color="positive" full (click)="declarerSinistre()" [disabled]="!sinistreForm.valid" block>Déclarer</button>
  </div>

And the TS file i only have

 declarerSinistre(){
    var headers = new Headers();
    headers.append('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');

    var params = 'ClientId='+1+'&NomConducteur='+this.userData.NomConducteur+'&TelConducteur='+this.userData.TelConducteur+'&CinConducteur='+this.userData.CinConducteur+'&latitude='+this.la+'&longitude='+this.lo;
    this.http.post(this.apiSinistre, params , {headers: headers})
      .subscribe(
        data => this.afficherAlert('Réussite','Sinistre Déclaré'),
        err => this.afficherAlert('Erreur','Sinistre Non Déclaré')
      );
  }

Posts: 1

Participants: 1

Read full topic

Background Service Implimentaton

Viewing all 49083 articles
Browse latest View live


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