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

Service vs Model file access

$
0
0

@breinsnet wrote:

So I have a model and a serviceModel… The model is a simple exported class with a few attributes and a couple of methods. The serviceModel is an ionic service

The model has many images, through a second model. I can access the images via model.images

The images are stored on the mobile filesystem. This is a must as the app has to work offline

The model can be uploaded and downloaded from an API. The modelService takes care of that.

Now the question is… how do I manage the images stored in the filesystem. I can see two options:

  • The modelService downloading the images, updating the image path and src attribute, also create directories. Basically taking care of everything related to manage the file and webview actions.

  • The modelService downloads the file to a temporary directory and send the path the the model. The model then copy the file to the correct location and creates the webview url.

The main difference is that I’ll be using cordova file and webview within the model or not.

I’m more prone for the second option, but would like your feedback before writing bunch of code.

Thanks

Posts: 1

Participants: 1

Read full topic


Ionic 4 Deeplinks

$
0
0

@asaldev wrote:

Hi
I read Deeplinks Document from HERE
i import it in app.component.ts file

import { Deeplinks } from '@ionic-native/deeplinks/ngx';

constructor(
    private deeplink: Deeplinks,
  ) { }

but i get error :
Error: “StaticInjectorError(AppModule)[AppComponent -> Deeplinks]: StaticInjectorError(Platform: core)[AppComponent -> Deeplinks]: NullInjectorError: No provider for Deeplinks!”

i search a lot but i can’t find any tutorial for Deeplinks in ionic 4 !!

Posts: 2

Participants: 2

Read full topic

Make compare between today and another date

$
0
0

@Tubiss wrote:

private eventDate: Date = new Date('July 16, 2019 12:24:00');//this is another date

private today : Date=new Date();

if(this.today==this.eventDate{
console.log(hello)

}

its not working as this like but when ı make below hello is displayed

 if(this.today!=this.evetDate){
console.log(hello)

          
}

ı mean private today : Date=new Date(); that is not getting today date please help me how can ı get current date

Posts: 1

Participants: 1

Read full topic

Loader in InAppBrowser

$
0
0

@pksquare wrote:

How i use loader in Inappbrower. I want to give a loader until the page os open in InAppBrowser in ionic 3

Posts: 2

Participants: 2

Read full topic

No Java files found that extend CordovaActivity

$
0
0

@ajeshbc wrote:

No Java files found that extend CordovaActivity.
[ERROR] An error occurred while running subprocess cordova.

IONIC CLI 5.2.3
NPM 6.9.2
Angular CLI: 7.3.9
Node: 8.12.0
OS: win32 x64
Angular: 7.2.15

Last installed module:
ionic cordova plugin add phonegap-plugin-push
npm install @ionic-native/push

Posts: 1

Participants: 1

Read full topic

Run application service when push notification received

$
0
0

@saxovic wrote:

Hello,

Is it possible to run some application service in the background when push notification is received (no matter what is the state of the app [foreground, background, closed]).

I use Firebase push notifications.

Thanks for any help.

Posts: 1

Participants: 1

Read full topic

Cambio de tabs y list

$
0
0

@Fernanditha wrote:

Hola con todos, hace unos dias mi profesor nos amdno hacer una aplicacion pero tengo un error en los tabs y list, y dice que eso debo cambiar he probado de todo pero aun esta el error y no me deja correr nada, ayudenme porfa

Posts: 1

Participants: 1

Read full topic

Share firebase project for more apps

$
0
0

@albertix wrote:

Hi all,
I have two apps, one for final users and another one for merchants. Both of them must use same firebase project. My config.xml has different ID for each, for example:

  • Project 1: “com.albertix.userapp”,
  • Project 2: “com.albertix.merchantapp”

I use the same files: “google-services.json” and “GoogleService-Info.plist” for both projects
When I build for ios, no problem, but for android I have this message:
“No matching client found for package name ‘com.albertix.merchantapp’”

How to solve ?

Thank You, Alberto

Posts: 1

Participants: 1

Read full topic


Ionic 4 segment not displaying properly (as in docs)

$
0
0

@danielcombain wrote:

Hey!

I’m using <ion-segment> and I don’t know if I’m missing something. The docs Segment docs displays something different for the default layout. I just get text and a border that highlights the selected. Doesn’t matter if I run in browser or on phone or changing between modes. Is this how it’s supposed to be or what am I doing wrong?
Also tried updating my project.
Also tried putting the segment in app.component.html if it was something wrong with my component. But that wasn’t the case either.
Also inspected the source code for the docs preview but there isn’t anything special in there.

Thanks in advance!

<ion-content>
  <ion-list-header>Map Type</ion-list-header>
  <ion-segment>
    <ion-segment-button value='gmap'>
      <ion-label>Standard</ion-label>
    </ion-segment-button>
    <ion-segment-button value='osm'>
      <ion-label>OSM</ion-label>
    </ion-segment-button>
    <ion-segment-button value='gsmap'>
      <ion-label>Satellite</ion-label>
    </ion-segment-button>
  </ion-segment>
</ion-content>

Ionic info:

Ionic:

   Ionic CLI                     : 5.2.2 (C:\Users\Daniel Karlsson\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.6.2
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : not available
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.1.1, (and 15 other plugins)

Utility:

   cordova-res : not installed
   native-run  : 0.2.7

System:

   NodeJS : v12.6.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.9.0
   OS     : Windows 10

Posts: 1

Participants: 1

Read full topic

How to do something in ionBackdropTap event?

$
0
0

@viva11vidy wrote:

I want to add a class to the ion-nav when i click on ion-backdrop.

Right now when sidemenu opens the ion-backdrop is appearing and when click on it its disappearing,
I have found that when we tap on ion-backdrop . ionBackdropTap event usually fired. But unable to find this.

Please can anybody put a light on it ?

Thank you

Posts: 1

Participants: 1

Read full topic

Ionic asset file location for web and devices with angular http

$
0
0

@ir2pid wrote:

I’m trying to read file from asset. My code is:

import { HttpClient, HttpParams, HttpHeaders, HttpRequest } from "@angular/common/http";

.
.
  assetURL: string = "../assets/";
  androidAssetURL: string = "'../www/assets/";

.
.

public readAssetFile(fileName: string) {
    var url = this.assetURL + fileName;

    if (this.platform.is("cordova") && this.platform.is("android")) {
      url = this.androidAssetURL + fileName;
    }

    this.log("reading data file location:" + url);
    return this.http
      .get(url, { responseType: "text" })
      .first()
      .toPromise();
  }

the location works for web

reading data file location:…/assets/data/about

but on device I get the location

reading data file location:’…/www/assets/data/about

but the real content isn’t read instead, get the HTML below as content

data file:<!DOCTYPE html>
<html lang="en" dir="ltr">

<head>
  <script data-ionic="inject">
    (function(w){var i=w.Ionic=w.Ionic||{};i.version='3.9.2';i.angular='5.2.11';i.staticDir='build/';})(window);
  </script>
  <meta charset="UTF-8">
  <title>Ionic App</title>
  <meta name="viewport"
    content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <met
.
.
.

Posts: 1

Participants: 1

Read full topic

Autoplay native audio ionic

JSON local

$
0
0

@bartlo wrote:

How can I get the code I used to have in Ionic 3 to work? I could consult a JSON and pass it to a list, now it’s no longer useful

import { Component } from ‘@angular/core’;
import { IonicPage, NavController} from ‘ionic-angular’;
import { Http } from ‘@angular/http’;
import ‘rxjs/add/operator/map’

@IonicPage({
name:“BC”
})
@Component({
selector: ‘page-bc’,
templateUrl: ‘belen-bc.html’,
})
export class BPHPage {
information:any;
constructor(public navCtrl: NavController, private http: Http) {
let localData = http.get(‘assets/json/our.json’).map(res => res.json().items);
localData.subscribe(data => {
this.information = data;
})
}
toggleSection(i) {
this.information[i].open = !this.information[i].open;
}

toggleItem(i, j) {
  this.information[i].children[j].open = !this.information[i].children[j].open;

  }
}

And the HTML

<button  class="ruta" ion-button round  color= "danger" (click)="ir_mapabelen()">Ver Ruta</button>


<p align ="Center"><b>Toca la estación para desplegar Horario</b></p>
<ion-list-header *ngFor="let item of information; let i = index" no-lines no-padding>

    <button ion-item (click)="toggleSection(i)" detail-none [ngClass]="{'section-active': item.open, 'section': !item.open}">
      <ion-icon item-left name="arrow-forward" *ngIf="!item.open"></ion-icon>
      <ion-icon item-left name="arrow-down" *ngIf="item.open"></ion-icon>
        {{ item.name }}
    </button>

    <ion-list *ngIf="item.children && item.open" no-lines>

      <ion-list-header *ngFor="let child of item.children; let j = index" no-padding>

        <button ion-item (click)="toggleItem(i, j)" *ngIf="child.children" class="child" detail-none>
          <ion-icon item-left name="add" *ngIf="!child.open"></ion-icon>
          <ion-icon item-left name="close" *ngIf="child.open"></ion-icon>
          {{ child.name }}
        </button>


        <ion-item *ngIf="!child.children" ion-item detail-none class="child-item" text-wrap>
          <h2>{{ child.name }}</h2>
          <p><b>{{ child.information }}</b></p>

        </ion-item>

        <ion-list *ngIf="child.children && child.open">

          <ion-item *ngFor="let item of child.children; let k = index" detail-none class="child-item" text-wrap>
            <h2>{{ item.name }}</h2>
            <p>{{ item.information }}</p>

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

      </ion-list-header>
    </ion-list>

  </ion-list-header>
</ion-list>

Posts: 1

Participants: 1

Read full topic

CLI: ionic cordova run/prepare android using wrong icon

$
0
0

@jp4velocity wrote:

I did create a special icon.png wich should be used when i pass a custom flag to the command line like so ionic cordova run android --device --myflag.

My custom hook sees this flag and copies the custom icon.png to resources/android, resources/ios and runs ionic cordova resources --cordova-res, which in turn generates the correct icon files within the sub-directories as i verified.

But somehow this icon is never used for the generated .apk and on my phone i still see the old icon used in my app list…

Deleting the /www directory and/or running ionic cordova prepare android --prod --myflag (which generates the correct icon, too) does not help either.

What am i missing here?

Ionic:

ionic (Ionic CLI) : 4.12.0 (C:\Users\jp\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : ionic-angular 3.9.6
@ionic/app-scripts : 3.2.3

Cordova:

cordova (Cordova CLI) : 9.0.0 (cordova-lib@9.0.1)
Cordova Platforms : android 8.0.0, ios 4.5.5
Cordova Plugins : cordova-plugin-ionic-webview 1.2.1, (and 17 other plugins)

System:

Android SDK Tools : 26.1.1 (C:\Users\jp\AppData\Local\Android\Sdk)
NodeJS : v10.15.3 (C:\Program Files\nodejs\node.exe)
npm : 6.10.1
OS : Windows 10

Posts: 1

Participants: 1

Read full topic

How is live update in Appflow

$
0
0

@weihangtang wrote:

I recently tried this new feature on my app, what do you guys think of it ?


The live update is cool, but I realized the new version is only stored in the local storage.
Also, if user click app -> clear storage
the new updated version will be gone and app will be reverted to it’s original version
let me know about you ideas and how you handle this situation, thanks !

Posts: 1

Participants: 1

Read full topic


Implementacion de Api google cloud sql

Warnning in the App Publish Google Play

$
0
0

@murilocg22 wrote:

i can’t publish my app because warning:

“This APK includes features and unused codes that are sent to users. Your app would be smaller if you used the Android App Bundle. When the app is not optimized for device settings, the download and installation size is larger than necessary. Larger apps have lower installation fees and take up space on users’ devices.”

The button of publish app not is enable

Posts: 1

Participants: 1

Read full topic

[V4] How to open a page from bottom to top, without being a modal

$
0
0

@ghido wrote:

Hi,

I’m trying to make something that should be very common, but I can’t find a solution.

From the initial screen of my app, I would like to open a registration flow in 3 steps.
I would like to open the first screen from bottom to top and then letting the user go through the 3 steps, showing the 3 pages with a horizontal animation.

If I just use the routerLink to open the first step of the registration, the page will enter from the right (bad), but then also the following step will do the same (good).

If I open the first step as a modal, it will enter from bottom to top (good), but if I use the routerLink to go to the second step, the modal will stay there, covering the page.

If I close the modal and open another one, it will disappear from top to bottom and open another one from bottom to top. Not want I want.

So, in order to solve it, I should find a way to:

  1. Have a multi-step modal
  2. Or: Set the first page transition in order to enter from the bottom, opening it with the routerLink and not as a modal

Thanks!

Posts: 1

Participants: 1

Read full topic

Pantallas donde no se ve el estado superior del celular

$
0
0

@lisandrodc wrote:

Hola, como estan comunidad? Espero que bien, he desarrollado una aplicación con Ionic 4 y tengo un inconveniente que tanto la pantalla inicial como las demas no muestran el estado superior del celular como el estado de carga de batería y la hora ( en realidad si se muestra pero casi sin verse). Tambien tengo el problema de que de la pantalla principal al apretar el “back” del celular no vuelve para atras, no se realiza ninguna acción.
Desde ya si alguien me puede ayudar se los agradezco.
Saludos!

Posts: 1

Participants: 1

Read full topic

Motion, detect orientation change

$
0
0

@Kyrax80 wrote:

Hello.

I have the following code using capacitor:

Motion.addListener('orientation', (e: MotionOrientationEventResult) => {
   console.log('Test')
})

However when I rotate my device it’s not writing “Test”, it doesn’t enter but it does enter the first time I call it.

Posts: 2

Participants: 2

Read full topic

Viewing all 70439 articles
Browse latest View live


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