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

BUILD ERROR, please HELP!


Pushing multiple data in an array doesn't work in ionic

$
0
0

@louis5017 wrote:

Hello, i’m actually trying to push some epub in an array to make them appear in a list in my home page, but when i try to push multiple epub like that this doesn’t while just with one book it work. does anyone have a solution?

export class HomePage {
  
  books: {}[];
  constructor() {
    let book1 = new Book();
    book1.label = "Moby Dick (unpacked)";
    book1.file =  "../../assets/books/agatha-christie-dix-petits-negres.epub";
    this.books.push(book1);

    this.books = [];
    let book2 = new Book();
    book2.label = "Moby Dick (.epub)";
    book2.file =  "../../assets/books/moby-dick.epub";
    this.books.push(book2);
  }
  ionViewDidLoad() {
    console.log('ionViewDidLoad HomePage');
  }
  show(book) {
    console.log('show', book);
    // this.navCtrl.push(BookPage, {
    //   book: book  
    // });
  }
}

Posts: 2

Participants: 2

Read full topic

Getting data from firebase are emtpy in html

$
0
0

@aligassan wrote:

I’m tryg to get data from my database firebase, but I get no data to show in list item html because I pushed UserId first in database.

items: Observable<any[]>;
itemsRef: AngularFireList<any>;

  constructor(,public fire: AngularFireAuth,public db: AngularFireDatabase) 
    {
        this.itemsRef = db.list('report/');
        // Use snapshotChanges().map() to store the key
        this.items = this.itemsRef.snapshotChanges().pipe(
          map(changes => 
            changes.map(c => ({ key: c.payload.key, ...c.payload.val() }))
          )
        );


      }

you can see here no data to show in list item

html

  <ion-list *ngFor="let item of items | async"> 
    <ion-item-sliding>
      <ion-item>
        <h2>{{item.title}}</h2>
        <p>{{item.name}}</p>
        <p>{{item.username}}</p>
        <p>{{item.dateadded}}</p>
    </ion-item>

      <ion-item-options side="right"> 
        <button ion-button color="danger" (click)="deletReport(item.key)">
          <ion-icon  ios="ios-trash" md="md-trash" item-end large></ion-icon>
        </button>
        <button ion-button color="primary" (click)="updatereport(item.key,item.name,item.title)">
          <ion-icon ios="ios-create" md="md-create"></ion-icon>
        </button>
      </ion-item-options>

    </ion-item-sliding>
  </ion-list>

Posts: 1

Participants: 1

Read full topic

No provider for NavParams error is coming In Ionic App

$
0
0

@raghavpamnani wrote:

I am transferring parameters from one component to app.component.ts but the error is coming. Error: No provider for NavParams.

This is my app.component.ts :slight_smile:

I am transferring parameters from one component to app.component.ts but the error is coming. Error: No provider for NavParams.

This is my app.component.ts :

import { FrontPage } from './../pages/front/front';
import { Component, ViewChild } from '@angular/core';
import { Nav, Platform, NavController, NavParams} from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { HomePage } from '../pages/home/home';
import { ListPage } from '../pages/list/list';
import { ProductPage } from '../pages/product/product';
import { LoginpagePage } from '../pages/loginpage/loginpage';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  @ViewChild(Nav) nav: Nav;
  menuclick: boolean = true;
  menuclick2: boolean = false;
  rootPage: any = FrontPage;
  uname: string;

  pages: Array<{title: string, component: any, name2: string}>;

  constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public navParams: NavParams) {
    this.initializeApp();
    this.uname = this.navParams.get('param1');
    this.pages = [
      { title: 'Home', component: FrontPage, name2: 'home' },
      { title: 'Product Categories', component: ProductPage, name2: 'basket' },
      { title: 'Merchandise', component: ProductPage, name2: 'man' },
      { title: 'My Orders', component: ProductPage, name2: 'cart' },
    ];

  }
'''

In this component, I am getting the navparam value like this this.uname = this.navParams.get('param1');

This is my loginpage.ts:


‘’’
import { Component } from ‘@angular/core’;
import { IonicPage, NavController, NavParams, AlertController } from ‘ionic-angular’;
import { RestapiProvider } from ‘…/…/providers/restapi/restapi’;
import { ListPage } from ‘…/list/list’;
import { FrontPage } from ‘…/front/front’;
import { CartPage } from ‘./…/cart/cart’;
import {Validators, FormBuilder, FormGroup } from ‘@angular/forms’;
import { MyApp } from ‘./…/…/app/app.component’;

@IonicPage()
@Component({
selector: ‘page-loginpage’,
templateUrl: ‘loginpage.html’,
})
export class LoginpagePage {
todo : FormGroup;
responseData : any;
userData = {“username”: “”, “password”: “”};
constructor(public navCtrl: NavController, public navParams: NavParams,
public restProvider: RestapiProvider, private formBuilder: FormBuilder, private alertCtrl: AlertController) {
this.todo = this.formBuilder.group({
username: [’’, Validators.required],
password: [’’, Validators.required],
});
}

ionViewDidLoad() {
console.log(‘ionViewDidLoad LoginpagePage’);
}

getloginUsers(){
  this.restProvider.getUsers(this.userData, 'user_Login').subscribe((data) => {
    console.log(data);
    if (data) {
      this.responseData = data;
      console.log(this.responseData.msg.name);
      if (this.responseData.status === 'success') {
        this.navCtrl.push(MyApp,{
          param1: this.responseData.msg.name,
        });
      }
      else{
        this.presentAlert();
      }
    }
  });

}

presentAlert() {
let alert = this.alertCtrl.create({
title: ‘Incorrect Username Or Password’,
buttons: [‘Dismiss’]
});
alert.present();
}

cardpage2()
{
this.navCtrl.push(CartPage);
}
}



Error: No provider for NavParams is coming. Any help is much appreciated

Posts: 1

Participants: 1

Read full topic

QuotaExceededError

$
0
0

@richardshergold wrote:

We are getting “QuotaExceededError” errors logged for some of our Android users - I’m assuming this is localStorage failing due to device space etc.

When we built the app we never added the cordova-sqlite-storage plugin but from googling the issue it seems this might solve the problem i.e the app is trying to use indexedDB and if we were to add the plugin it will be able to use SQLite.

I want to make sure that once the plugin is added that storage continues to work for all unaffected users (all our iOS users + the 95% of our Android users that are not having the issue) i.e when the app starts up after upgrading it will retrieve their old IndexedDB values - is this simply a case of putting IndexedDB first in the driveOrder in app.module.ts ??? And, if we have IndexedDB first, will it fail-over to SQLite for the users that currently do get the QuotaExceededError? Anyone know?

Posts: 1

Participants: 1

Read full topic

No response on database call

$
0
0

@Josef87 wrote:

I try to get a value from a database. It is sensor data, which i wanna save in from an odroid on the database.

The problem is have is, that i cannot get the value into my ionic 3 app.
The Php file should work, when i open the file, i get the right number in the browser. for testing i also took just a .txt-file with the number 9 inside. but it still doesn´t work. It still stays empty. I have global variables into the provider, which i wanna hold up-to-date.

here my code:

global.ts (provider)

import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http';



@Injectable()
export class GlobalProvider {

dif1:number;

constructor(public http: HttpClient){}


load() {

    this.http.get("http://192.168.131.221/test/ultras.1.txt")
    .subscribe((data : any) => {
        this.dif1 = parseInt(JSON.stringify(data));
    })
}

}

data.html (call of the provider)

 <button ion-button (click)="global.load()">push</button>
    <div class="llDataContainer">
        <div class="llDataBox llDataBox-2"></div>
        <div class="llDataBox llDataBox-2"></div>
        <div class="llDataBox llDataBox-2">ultra1:</div>

        <!--distance value (ultra1)-->
        <div class="llDataBox llDataBox-2">{{ global.dif1 }} cm</div>   

if i push the button, still it stays empty.

Posts: 1

Participants: 1

Read full topic

Theming in ionic

$
0
0

@ir2pid wrote:

I learned some ionic theming tutorials but can’t get a proper understanding.

How do I change the following controls

  • The floating hint “Email” should be grey,
  • The textboxes (public and password *s) should be dark grey
  • The selected blue underline shouldn’t be there
  • The selected green underline shouldn’t be there
  • The input+hint should be in a rounded rectangle box

Some pointers to how to reuse the theme attributes and good tutorials to get a concept would be appreciated!

Posts: 1

Participants: 1

Read full topic

Cordova-plugin-ionic-webview with UseScheme set to true

$
0
0

@ges wrote:

Hi,

I’ve upgraded cordova-plugin-ionic-webview to v2.3.1 as recommended in the security alert: https://ionic.zendesk.com/hc/en-us/articles/360015176994-2019-01-03-Security-Alert-for-cordova-plugin-ionic-webview

When i set in my config.xml (ionic-v1), I can’t serve any pictures from the new protocol ionic://app.
I Know it’s probably related to the Content-Security-Policy and the allow-navigation parameters but i’ve tried everything and img keeps getting blocked under IOS 11.
Does anyone is able to serve images with this setup ?

Posts: 1

Participants: 1

Read full topic


App for asset tracking

$
0
0

@iversa wrote:

We are starting with developing an Ionic app which will be used for asset tracking using MapBox. Here is a good description of what we want to do https://blog.mapbox.com/how-to-do-asset-tracking-cb27ba2da5ab

The first step is to find a solution for pushing location and other attribute data from a mobile device to a Stream Processor that will listen for the data. Does anyone know what service or plugin we could use for that?

We are new at this and here is how, map box support described the process

Blockquote The device/hardware would need to its own software with an API service that can PUSH location and attribute data from. The Stream Processor listens for this information and can collect it on their end (e.g. PubNub, Pusher, etc.). The Database can then be used to store this info. All of this is considered the API Gateway and Mapbox is the final piece where you can poll or process info from the API Gateway so you can visualize it on your map.

Posts: 1

Participants: 1

Read full topic

[rc1] ion-input not working in chrome browser

$
0
0

@jjdev wrote:

I am not getting any interaction with the ion-input when using it in Chromium, besides using the TAB key.

At first it appeared to be an issue with the input being contained with in a slide (this), but after removing the slides, the issue has persisted.

  • The app opens with no problem in Mozilla and the input(s) interacts correctly.
  • The app also has the same issue as Chromium while running in Opera.

Is anyone else facing this issue with chromium and ionic rc1? chromium is on the latest build for linux:

Version 71.0.3578.98 (Official Build) snap (64-bit)

Ionic:

   ionic (Ionic CLI)             : 4.7.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.0-rc.1
   @angular-devkit/build-angular : 0.11.4
   @angular-devkit/schematics    : 7.1.4
   @angular/cli                  : 7.1.4
   @ionic/angular-toolkit        : 1.2.2

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : not available
   Cordova Plugins       : not available

System:

   Android SDK Tools : 26.1.1 (/opt/android-sdk)
   NodeJS            : v10.1.0 (/usr/local/bin/node)
   npm               : 6.5.0
   OS                : Linux 4.15

Posts: 1

Participants: 1

Read full topic

Unity 3D integration & use

$
0
0

@tpotier wrote:

Hi
I’m a unity developer and i have 0 knowledge about ionic.
I would like to have an overview of what can be done using unity & ionic framework.
Examples, sample projects or tutorials would be greatly appreciated.

Thanks :slight_smile:

Posts: 1

Participants: 1

Read full topic

How Swipe back from side menu in Ios?

$
0
0

@lucaboga wrote:

Hi, I’m creating an ionic app with tabs and side menu. I created a page named menu, and a page named tabs, not all pages must have tabs at the end. When I push a page from the menu that’s not must have tabs, the swipe back for iOS is not working and I think that there are problems regarding the navigation.
Can someone tell me how to combine menu and tabs in the right way? Thank you

This is my code

openPage(page: PageInterface){

  this.navCtrl.push(page.pageName);
}

Posts: 1

Participants: 1

Read full topic

Unable to style the active tab in ionic4 angular

$
0
0

@sridhar-aravind wrote:

Hi Everyone,

I’m using ionic v4 to create my first angular project.
The version of the @ionic/angular I use is 4.0.0-rc.0.

I tried to customize the style of my active tab by providing a custom color to it and also a border for its bottom edge. But I couldn’t get it working.
I tried adding the CSS variable --color-selected. but it only changes the color of the label when I hover on it. not after it has been selected.

 <ion-tabs #tabs> 
        <ion-tab-bar slot="top">
            <ion-tab-button tab="subcateg/All">
                    <ion-label>All</ion-label>
            </ion-tab-button>
    
            <ion-tab-button *ngFor="let subCateg of category.subcategories" tab="subcateg/{{subCateg}}">
                <ion-label>{{subCateg}}</ion-label>
            </ion-tab-button>
        </ion-tab-bar>
    </ion-tabs>

Also, I have to dynamically call a tabs.select(‘subCateg/All’) from ngAfterViewInit in my typescript file to make the first tab to appear.

whereas if I create a default project ionic start tabs-issue tabs --type=angular, the selected tab is highlighted by displaying the ion-label in the color specified in --color-selected.

I do not see much difference between my approach and the one in the default boilerplate code.

Can anyone point me in the right direction?? How to set a CSS style to the activeTab in the ion-tabs.

P.S: if I manually specify a selectedTab attribute to the ion-tab-bar element, that specific tab takes up the color defined in the --color-selected variable.

Posts: 1

Participants: 1

Read full topic

MusicControl

$
0
0

@dupphil wrote:

Dear,

I am analyzing crash reports. My main crashes are on MusicControl. I cannot find how to find a solution and fix it.
Can you help me ?
Philippe

java.lang.ArrayIndexOutOfBoundsException:
at android.util.ArrayMap.freeArrays (ArrayMap.java:224)
at android.util.ArrayMap.put (ArrayMap.java:471)
at android.os.Bundle.putParcelable (Bundle.java:426)
at android.app.Notification.addFieldsFromContext (Notification.java:2110)
at android.app.Notification.addFieldsFromContext (Notification.java:2102)
at android.app.Notification$Builder.build (Notification.java:3997)
at com.homerours.musiccontrols.MusicControlsNotification.updateNotification (MusicControlsNotification.java:74)
at com.homerours.musiccontrols.MusicControls$2.run (MusicControls.java:110)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:607)
at java.lang.Thread.run (Thread.java:761)

java.lang.OutOfMemoryError:
at dalvik.system.VMRuntime.newNonMovableArray (Native Method)
at android.graphics.Bitmap.nativeCreateFromParcel (Native Method)
at android.graphics.Bitmap.access$100 (Bitmap.java:32)
at android.graphics.Bitmap$1.createFromParcel (Bitmap.java:1472)
at android.graphics.Bitmap$1.createFromParcel (Bitmap.java:1464)
at android.widget.RemoteViews$BitmapCache. (RemoteViews.java:952)
at android.widget.RemoteViews. (RemoteViews.java:1733)
at android.widget.RemoteViews. (RemoteViews.java:1725)
at android.app.Notification$BuilderRemoteViews. (Notification.java:5084)
at android.app.Notification$BuilderRemoteViews.clone (Notification.java:5096)
at android.app.Notification$BuilderRemoteViews.clone (Notification.java:5082)
at android.app.Notification.cloneInto (Notification.java:1510)
at android.app.Notification.clone (Notification.java:1427)
at android.app.NotificationManager.notify (NotificationManager.java:149)
at android.app.NotificationManager.notify (NotificationManager.java:123)
at com.homerours.musiccontrols.MusicControlsNotification.updateNotification (MusicControlsNotification.java:75)
at com.homerours.musiccontrols.MusicControls$2.run (MusicControls.java:110)
at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:587)
at java.lang.Thread.run (Thread.java:818)

Posts: 1

Participants: 1

Read full topic

Build browser as windows style


DevApp Google Login via Firebase

$
0
0

@IndyJones72 wrote:

I probably just need to run it on a real device, but I’m assuming the Ionic DevApp won’t work if you’re using some type of Firebase authentication system correct?

Posts: 1

Participants: 1

Read full topic

iPhone and iPad in single Ionic project

$
0
0

@ArvindIonic wrote:

Hi Ionic team,

Am new in Ionic, I want to create a single Ionic app for iPhone and iPad, App have same functionality in both the devices but have different UI design. Can anyone please let me know is it possible achieve in ionic.

Posts: 1

Participants: 1

Read full topic

Issue with file app.component.ts in my app

$
0
0

@Deepak1233 wrote:

Hello guys
I am building an app and stucked somewhere in app.ccomponent.ts
I know its possible just wondering if you guys can give me some idea how to achieve this

So i am using a splitpane for sidebar and kept codes of sidebar in app.html because i want it to be accessible on each pages and at the top of the side bar i have kept some user profile info like name and profile pic etc and m getting these information after login or signup by using localstorage

after login there is profile info in my localstorage and even i can access it everywhere but still it is not updating sidebars profile info
although it is updating but when i refresh my browser or reload in ionic lab I havent tested it in mobile yet but m sure if it is not working here it wont make any change on device either.

this is sidebars image

How can i update this after login or signup?

app.component.ts code:
I have kept this code in constructor -

if(localStorage.getItem(‘cookie_data’)){
const data=JSON.parse(localStorage.getItem(‘cookie_data’));
this.fetched_info=data.userData;
if(this.fetched_info.gender==‘Female’){
this.img=‘profile-image-girl.jpg’;
} else{
this.img=‘profile-image-men.jpg’;

       }
     } else{
  this.rootPage=LoginPage;

                

     }

Posts: 1

Participants: 1

Read full topic

How to create photo albums using ionic 2

How to get long running http get

Viewing all 48981 articles
Browse latest View live


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