Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 70435 articles
Browse latest View live

Ionic 4 swipe to go back gestures?

$
0
0

@tbaumer22 wrote:

Hello everyone,

I was wondering if my application is broken or if swiping on pages to go back has been disabled in Ionic 4? Or perhaps a better question - has this ever existed in Ionic?

If swiping gestures don’t come with Ionic, are there any good, angular-ready packages I can use in my project to enable for this functionality? I currently have pages where I need to swipe to go back on and more importantly a modal that I’d like to be able to swipe down on to dismiss it.

Any help or recommendations would be much appreciated.

Posts: 1

Participants: 1

Read full topic


The filesystem api lacks streams and random access apis

$
0
0

@sroussey1 wrote:

Particularly on mobile, having streams and random access prevent out of memory errors if you must deal with a large file.

Posts: 1

Participants: 1

Read full topic

Error crbug

Updating Ionic Native Plugins problems

$
0
0

@sroussey1 wrote:

When using cordova-plugin-advanced-http and @ionic-native/http it works great on mobile apps (via capacitor), but on website/electron I get an error. On web it fails as there is no cordova object on window. Electron says:

Native: tried calling HTTP.get, but the HTTP plugin is not installed.
Install the HTTP plugin: 'ionic cordova plugin add cordova-plugin-advanced-http'

So I am using Capacitor, but not Ionic Framework, so the suggestion is odd and goes against the Capacitor instructions:

https://capacitor.ionicframework.com/docs/cordova/using-cordova-plugins/

Where it says (but I am substituting the example names with the ones I used):

npm install @ionic-native/http
npm install cordova-plugin-advanced-http
npx cap sync

This seemed to work just fine on iOS. But failed as described above. So at this point I install cordova and ionic cli tools. So I can follow their instructions:

npm install -g cordova ionic
ionic integrations enable cordova --add
ionic cordova plugin add cordova-plugin-advanced-http

This added a lot of files to the project, but did not fix the issue at hand. So now what do I do?

Posts: 1

Participants: 1

Read full topic

SQLite import and export

$
0
0

@MikeAwad wrote:

HI ALL
I want to back up the SQLite database and import and export it to and from the application and choose where to save
SD card - google Drive …
I searched a lot but could not find a useful answer to my question
Is there any help?

Thanks

Posts: 1

Participants: 1

Read full topic

Navigating between components

$
0
0

@khashashin wrote:

I have following routing modules:

############# app-routing.module.ts
const routes: Routes = [
    {
        path: '',
        redirectTo: '/tutorial',
        pathMatch: 'full'
    },
    {
        path: '',
        loadChildren: './pages/tabs/tabs.module#TabsPageModule'
    },
    {
        path: 'register',
        loadChildren: './auth/register/register.module#RegisterPageModule'
    },
    {
        path: 'login',
        loadChildren: './auth/login/login.module#LoginPageModule'
    },
    {
        path: 'tutorial',
        loadChildren: './pages/tutorial/tutorial.module#TutorialPageModule',
        canLoad: [TutorialGuard]
    }
];

############# tabs.router.module.ts
const routes: Routes = [
    {
        path: '',
        redirectTo: '/tabs/home',
        pathMatch: 'full'
    },
    {
        path: 'tabs',
        component: TabsPage,
        children: [
            {
                path: 'home',
                children: [
                    {
                        path: '',
                        loadChildren: '../home/home.module#HomePageModule'
                    }
                ]
            },
            {
                path: 'profile',
                canActivate: [AuthGuard],
                children: [
                    {
                        path: '',
                        loadChildren: '../profile/profile.module#ProfilePageModule'
                    }
                ]
            },
            {
                path: 'dictionary',
                children: [
                    {
                        path: '',
                        loadChildren:
                            '../dictionary/dictionary.module#DictionaryPageModule'
                    }
                ]
            }
        ]
    }
];

############# dictionary-routing.module.ts
const routes: Routes = [
    {
        path: '',
        component: DictionaryPage,
        children: [
            {
                path: 'letter/:letter',
                component: LetterPage
            },
            {
                path: 'add',
                component: WordAddComponent
            },
            {
                path: 'word-detail/:id',
                component: WordDetailComponent
            }
        ]
    }
];

And routes for DictionaryPage components does not have modules to lazy load them, instead it has only children components and paths. This setup works without error but the views does not load. Going to the url http://localhost:8100/tabs/dictionary/letter/H does not load new view but the url in the browser changes without any errors. where did i make a mistake?

Posts: 1

Participants: 1

Read full topic

Ionic 4 Card display bug

$
0
0

@tbaumer22 wrote:

Hey everyone,

I’m currently having an issue where cards in Ionic 4 won’t render for me if a card only consists of an image component. For example:

<ion-card>
  <ion-img src="{{image}}"></ion-img>
</ion-card>

This card renders as white space with no card even though the image variable has been set to a valid image url. You may think that there could be a bug in my code in setting this variable, however when I add anything other than the image to the card, the card successfully renders with the image. For example:

<ion-card>
  <ion-img src="{{image}}"></ion-img>
  hi
</ion-card>

This card renders fine, but in my case, I don’t want the card to have anything on it except the image itself.

Are there any workarounds to this?
I’m also not sure if this a problem that only I’m experiencing, so any help would be greatly appreciated!

Posts: 5

Participants: 2

Read full topic

Ionic 4 Google + Plugin not works

$
0
0

@Dani97EPN wrote:

I want to bring google auth to my app. I made all the steps from many tutorials but not works.
I executed the function login() but seems like is not executed

If anyone has the same error and could fix it please can share their solution, please

Posts: 1

Participants: 1

Read full topic


Error when add plugin camera and etc

How to save captured image from camera or selected from gallery image in sqlite

$
0
0

@pt2609 wrote:

In my app when i take a picture from camera or gallery and shows that image on screen and when i proceed and again come back to that image page all images are gone. I’m trying to save this image until clear the cache. Please help me how to do this i’m very new in ionic.

Posts: 1

Participants: 1

Read full topic

TypeError: Cannot read property '0' of undefined TypeError: Cannot read property '0' of undefined

$
0
0

@Tubiss wrote:

public product: any;

loadProducts(){
  this.myProvider.load()
  .then(data => {
    console.log(data);
    this.product= data;
   });
}

this.eventDate=new Date(this.product[0].start_time); //when ı write this code its givin error like this TypeError: Cannot read property ‘0’ of undefined TypeError: Cannot read property ‘0’ of undefined

so plaese help me how can ı use peroducts something like product[0].

Posts: 1

Participants: 1

Read full topic

Virtual scroll no longer working correctly after upgrading to 4.6.*

$
0
0

@Slavrix wrote:

My Virtual Scroll has been broken somehow between versions 4.5.0 and 4.6.*

Any assistance in helping me track down the issue so I can report it correctly on the github would be useful.

 <ion-virtual-scroll [items]="filteredEvents" approxItemHeight="200px" [headerFn]="eventDaySplit" approxHeaderHeight="35px">

    <ion-item-divider *virtualHeader="let header">

      <ion-label>{{header | amDateFormat:'dddd DD MMMM'}}</ion-label>
    </ion-item-divider>
    <ion-card *virtualItem="let event; let itemBounds = bounds;">

      <ion-item [ngClass]="rightBorderClass(event.attending)" (click)="gotoViewEvent(event, event.attending)">
          <ion-label text-wrap>

          <ion-text color="primary" *ngIf="event.name">
            <h2>
              <span *ngIf="event?.group_details?.length==1">{{event.group_details[0].shortName}} | </span>
              <span *ngIf="event?.group_details?.length>1">{{event.group_details.length}} Groups | </span>
              {{event.name}}
            </h2>
          </ion-text>
          <ion-text color="primary" *ngIf="!event.name"><h2>No Event Name</h2></ion-text>
          <ion-text color="primary" *ngIf="event.type"><h2> {{event.type}} <span *ngIf="event.type=='Game' || event.type=='Final'">vs {{event.opponent}}</span></h2></ion-text>

          <p>
            {{event.startDatetime | amDateFormat:'HH:mm' }}<span *ngIf="event.endDatetime"> to {{event.endDatetime | amDateFormat:'HH:mm' }}</span>
          </p>

          <ion-text color="danger" *ngIf="event.cancelled"><h2><i>CANCELLED</i></h2></ion-text>
          <p id="location-text" *ngIf="event.location">{{event.location}}</p>
          <p id="location-text" *ngIf="event.address.readable">{{event.address?.readable}}</p>

        <p class="italic">
          {{event.private?'Private':'Public'}}
        </p>

        <p *ngIf="event.childInvited.length==1">Child Invited: {{event.childInvited.length}}</p>
        <p *ngIf="event.childInvited.length>1">Children Invited: {{event.childInvited.length}}</p>
          </ion-label>
          <ion-icon color="dark" name="lock" slot="end" *ngIf="event.cancelled || isInPast(event.startDatetime)"></ion-icon>
      </ion-item>

    </ion-card>

  </ion-virtual-scroll>

I’m filling in the filteredEvents object inside an observable server call.

EventService.call('event.getEvents', this.selectedOrganisation._id, this.activities.theDate.format(), this.profile.isAdmin).subscribe((events: any) => {
        this.events = this.dateSortPipe.transform(events);
        this.filteredEvents = this.applyFiltersToEvents(this.events);
        this.virtualScroll.checkEnd();
          // if (this.filteredEvents.length > 0) {
          //   setTimeout(() => {
          //     this.virtualScroll.checkRange(0, 5);
          //   }, 250);
          // }
        // this.refs.markForCheck();
        // if (this.filteredEvents.length > 0) {
        //   setTimeout(() => {
        //     this.virtualScroll.checkRange(0, 5);
            // this.virtualScroll.checkEnd();
            // this.refs.detectChanges();
            this.presenters.dismissLoader();
        //   }, 250);
        // }
        console.log('event sub list admin', this.events);
      });

@ionic/angular:4.5.0

@ionic/angular:4.6.0
@ionic/angular:4.6.1
@ionic/angular:4.6.2

Posts: 1

Participants: 1

Read full topic

How to do alipay in ionic 4

$
0
0

@ice174 wrote:

I am new in ionic 4. I want to add alipay plugin in my ionic apps. I saw all the tutorial do like this only :

import { Alipay } from '@ionic-native/alipay/ngx';

constructor(private alipay: Alipay) {

//alipayOrder is a string that has been generated and signed by the server side.
this.alipay.pay(alipayOrder)
   .then(result => {
      console.log(result); // Success
   })
   .catch(error => {
      console.log(error); // Failed
   });

}

But this only show the loading say openning the alipay but do not open the alipay page to pay. What I need to change inside the code? I want to send the total payment to use the alipay do payment. Anyone can help me?

Posts: 1

Participants: 1

Read full topic

How to access the current battery status in an Ionic 4 / Angular + Cordova application?

$
0
0

@Jil wrote:

Goal

I would like to access the current battery status in an Ionic 4 / Angular + Cordova application.

What I have tried

I followed the instruction https://ionicframework.com/docs/native/battery-status on a clean blank Ionic 4 app.

app.module.ts

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { BatteryStatus } from '@ionic-native/battery-status/ngx';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';

@NgModule({
  declarations: [AppComponent],
  entryComponents: [],
  imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
  providers: [
    StatusBar,
    SplashScreen,
    BatteryStatus,
    { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

home.page.ts

import { Component } from '@angular/core';
import { BatteryStatus } from '@ionic-native/battery-status/ngx';

@Component({
  selector: 'app-home',
  templateUrl: 'home.page.html',
  styleUrls: ['home.page.scss']
})
export class HomePage {
  constructor(private batteryStatus: BatteryStatus) {
    // watch change in battery status
    const subscription = this.batteryStatus.onChange().subscribe(status => {
      console.log(status.level, status.isPlugged);
    });
  }
}

The Problem

Sadly I always get the following error, anyone an idea what I’m doing wrong?

Error

ERROR TypeError: Invalid event target
    at setupSubscription (fromEvent.js:50)
    at Observable._subscribe (fromEvent.js:24)
    at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable._trySubscribe (Observable.js:43)
    at Observable.push../node_modules/rxjs/_esm5/internal/Observable.js.Observable.subscribe (Observable.js:29)
    at new HomePage (home.page.ts:12)
    at createClass (core.js:22150)
    at createDirectiveInstance (core.js:22029)
    at createViewNodes (core.js:23255)
    at createRootView (core.js:23169)
    at callWithDebugContext (core.js:24177)

Posts: 1

Participants: 1

Read full topic

Make button enable

$
0
0

@Tubiss wrote:

<button ion-button shape="round" size="small" color="color2">Derse Katıl</button>

how can ı make this button enable

Posts: 2

Participants: 2

Read full topic


Which Ad Networks work with Ionic besites Admob?

$
0
0

@reinerluke97 wrote:

Since I got a 30 day ban on Adsense/Admob because someone “Click Bombed” my Banner Ads I search for another Ad Network which would work with Ionic.

But it seems the only Cordova Plugin out there which works is the cordova-admob plugin.
Are there any Ad Netwoks which can be used with Ionic or am I fked up right now?

Posts: 1

Participants: 1

Read full topic

Searching by Id from angular in web api issue

$
0
0

@pieee93 wrote:

Hello to everyone.
I installed angular in web api for simulating a data server and when i take all the objects (in my case the db has only “evento” objects) to display in the “Lista” page (my homepage) there is no problem. When i want to fetch one “evento” from the db for details in the page “dettaglievento” i’m not able to take one of them. The first time i get an Not Found 404 error on “api/evento/11” (11 is the id of my first evento object) but i fixed it using " /?idevento=${idevento}" to my base url. The problem now is that i have no more error displayed but i’m unable to display in “dettaglievento” details about a single “evento” .
This is my “db”

import { Injectable } from '@angular/core';
import { InMemoryDbService } from 'angular-in-memory-web-api';
import {Evento} from './model/evento.model';

@Injectable({
  providedIn: 'root'
})
export class InMemoryDataService implements InMemoryDbService {
    createDb() {
        const eventi = [
            { idevento: 11 ,
                nomeevento: 'Metallica',
                sottotitolo : 'Master of puppets',
                descrizione: 'I Metallica tornano ad emozionare le platee di tutto il mondo con il loro tour, ' +
                    'partecipa anche tu!!!',
            },
            { idevento: 12,
                nomeevento: 'MetallicA',
                sottotitolo : 'Master of puppets',
                descrizione: 'I MetallicA tornano ad emozionare le platee di tutto il mondo con il loro tour, ' +
                    'partecipa anche tu!!!',
            },
            { idevento: 13,
                nomeevento: 'Antonio',
                sottotitolo : 'Lina mi vida',
                descrizione: 'I Metallica tornano ad emozionare le platee di tutto il mondo con il loro tour, ' +
                    'partecipa anche tu!!!',
            },




        ];


        return{eventi};
 }
}

This is my Evento.service


import { HttpClient, HttpHeaders } from '@angular/common/http';
import {Injectable} from '@angular/core';
import {Observable, of} from 'rxjs';
import { catchError, map, tap } from 'rxjs/operators';
import { MessageService } from './message.service';


import { Evento } from 'src/app/model/evento.model';
const httpOptions = {
    headers: new HttpHeaders({ 'Content-Type': 'application/json' })
};


@Injectable({
    providedIn: 'root',
})

export class EventoServiceService {

    private eventiUrl = 'api/eventi';  // URL to web api

    constructor(private http: HttpClient, private messageService: MessageService) {

    }
    list(): Observable<Evento[]> {

        return this.http.get<Evento[]>(this.eventiUrl);
    }

    getEvento(idevento: number): Observable<Evento> {
        const url = `${this.eventiUrl}/?idevento=${idevento}`;
        return this.http.get<Evento>(url).pipe(
            tap(_ => this.log(`fetched hero id=${idevento}`)),
            catchError(this.handleError<Evento>(`getHero id=${idevento}`))
        );
    }
    private handleError<T>(operation = 'operation', result?: T) {
        return (error: any): Observable<T> => {

            // TODO: send the error to remote logging infrastructure
            console.error(error); // log to console instead

            // TODO: better job of transforming error for user consumption
            this.log(`${operation} failed: ${error.message}`);

            // Let the app keep running by returning an empty result.
            return of (result as T);
        };
    }
    private log(message: string) {
        this.messageService.add(`EventoServiceService: ${message}`);
    }

}

my dettaglievento.page.ts

import {Component, Input, OnInit} from '@angular/core';
import {Observable} from 'rxjs';


import {Evento} from '../../model/evento.model';
import {ActivatedRoute, ParamMap} from '@angular/router';
import {EventoServiceService} from '../../services/evento.service';

@Component({
  selector: 'app-dettaglievento',
  templateUrl: './dettaglievento.page.html',
  styleUrls: ['./dettaglievento.page.scss'],
})
export class DettaglieventoPage implements OnInit {
  @Input() evento: Evento;

  constructor(private route: ActivatedRoute,
              private eventoService: EventoServiceService,
             ) { }

  ngOnInit() {
    this.getEvento();
  }

   getEvento() {

     const idevento = +this.route.snapshot.paramMap.get('?idevento');
     this.eventoService.getEvento(idevento).subscribe(evento => this.evento = evento);

   }
  }




and my dettaglievento.page.html



<ion-header>
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-back-button  defaultHref="/"></ion-back-button>
    </ion-buttons>
    <ion-title text-center="center">{{"DETAGLI_EVENTO_TITLE"| translate}}</ion-title>
    <ion-icon id="iconcina" align-items-end="right" name="contact" routerLink="/dettagliorganizzatore" routerDirection="forward">
    </ion-icon>
  </ion-toolbar>
</ion-header>

<ion-content padding="true">


  <ion-card *ngIf="evento">

 <ion-slides [pager]="true">
  <ion-slide>

    <img src="../assets/musipr/LOGO2.JPG">
  </ion-slide>
  <ion-slide>
    <img src="../assets/musipr/LOGO2.JPG">
  </ion-slide>
 </ion-slides>

  <ion-card-header>
    <ion-card-title>{{evento.nomeevento}}</ion-card-title>
    <ion-card-subtitle>{{evento.sottotitolo}}</ion-card-subtitle>
  </ion-card-header>

  <ion-card-content>
    {{evento.descrizione}}
  </ion-card-content>

  </ion-card>

  <ion-button  color="tertiary" >{{"BUY_TITLE"| translate}}</ion-button>


</ion-content>


<ion-fab vertical="bottom" horizontal="end" slot="fixed">
  <ion-fab-button  >
    <ion-icon  id="navigation" name="compass"></ion-icon>
  </ion-fab-button>
</ion-fab>

my app-routing.module.ts

import { NgModule } from '@angular/core';
import { PreloadAllModules, RouterModule, Routes } from '@angular/router';

const routes: Routes = [
  { path: '', redirectTo: 'tab', pathMatch: 'full' },
  { path: 'home', loadChildren: './home/home.module#HomePageModule' },
  { path: 'lista', loadChildren: './pages/lista/lista.module#ListaPageModule' },
  { path: 'mappa', loadChildren: './pages/mappa/mappa.module#MappaPageModule' },
  { path: 'chatlist', loadChildren: './pages/chatlist/chatlist.module#ChatlistPageModule' },
  { path: 'dettaglievento/:idevento', loadChildren: './pages/dettaglievento/dettaglievento.module#DettaglieventoPageModule' },
  // tslint:disable-next-line:max-line-length
  { path: 'dettagliorganizzatore', loadChildren: './pages/dettagliorganizzatore/dettagliorganizzatore.module#DettagliorganizzatorePageModule' },
  { path: 'donazione', loadChildren: './pages/donazione/donazione.module#DonazionePageModule' },
  { path: 'acquisto', loadChildren: './pages/acquisto/acquisto.module#AcquistoPageModule' },
  { path: 'pagamento', loadChildren: './pages/pagamento/pagamento.module#PagamentoPageModule' },
  { path: 'profiloutente', loadChildren: './pages/profiloutente/profiloutente.module#ProfiloutentePageModule' },
  { path: 'login', loadChildren: './pages/login/login.module#LoginPageModule' },
  { path: 'signup', loadChildren: './pages/signup/signup.module#SignupPageModule' },
  { path: 'editaevento', loadChildren: './pages/editaevento/editaevento.module#EditaeventoPageModule' },
  { path: 'tab', loadChildren: './pages/tab/tab.module#TabPageModule' },
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  ],
  exports: [RouterModule]
})
export class AppRoutingModule { }

Posts: 1

Participants: 1

Read full topic

Stream video from camera, device to device

$
0
0

@ercnst wrote:

So… I have this idea that im trying to develop, but i have been stuck on the streaming and connecting part… I want to connect two devices using either bluethooth or wifi, and use one as the receiver and the other one the sender of the stream.

Is this possible using Ionic? I have been looking at some WebRTC but not sure it’s right.

Any suggestions on how i would do this, both the connection part and the streaming part.

Thanks.

Posts: 1

Participants: 1

Read full topic

Capacitor 2 and Security

$
0
0

@sroussey1 wrote:

Capacitor 2.0 should fix the XSS issue that Cordova has always had, and split the code between privileged code (backendish) and UI code, and be multi-process.

Capacitor 1.1 turned off Electron security protections to make things work as they always have. In Capacitor 2 you have the opportunity to have the business logic run in a separate thread than the UI, and add the privileged code there. And such logic would not need to hold up the UI thread, allowing for a smoother app.

One XSS in an iPhone app and maybe they own that app. One XSS in an Electron app and they could wipe out your whole PC and life. There is a reason why Electron changed the defaults. You could even use multiple “backend” hidden renders (see electron-remote for an example).

Posts: 1

Participants: 1

Read full topic

How to test my app on my device without Ionic serve

$
0
0

@salaheddinezakaria wrote:

Hello,
I’m new to ionic and i just finished my first app and it work perfectly on my browser, but I just wanna know how to run it on my android device without the need of ‘ionic serve’ being launched on my PC, I mean my app currently works on my mobile but only if I run ‘ionic serve’ on my pc is there any way to make it run without the need of that. Or I’m missing something ?

Posts: 1

Participants: 1

Read full topic

Viewing all 70435 articles
Browse latest View live


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