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

Include Commit Build inside Ionic App

$
0
0

Hey folks,

is there any way to somehow include the git commit build inside the Ionic App.

Let me describe it a little bit further:
I have different repositories for my apps with each different branches (dev / master / production). I submit all my changes to dev and do a merge request to master - master is spins up a staging from master. Now inside my master branch I would like to be able to include the commit tag at the bottom of my sidemenu for example. Is there any way how I could do this?

My repository by the way builds an image from a Dockerfile.

Thanks in advance,
Oliver

1 post - 1 participant

Read full topic


Ionic Storage ionic version 5.4.7

$
0
0

Hey all,

I am developing notepad app and I want to save notes in Ionic Storage, however after refreshing the page all notes saved in Ionic Storage are disappeared.
First it was saving under WebSQL and I have configured the storage using driverOrder, however no success. Still the notes are not shown after refresh.

After adding these lines in app.module.ts notes even are not stored in storage.

IonicStorageModule.forRoot( {

       driverOrder: ['indexeddb'] })

],

Does anyone of you faced the similar issue and do you have idea how can I handle this issue.

Thanks a lot beforehand.

1 post - 1 participant

Read full topic

Need general help/suggestion for online storage (Firebase?)

$
0
0

Hey everybody , i would like to build in an online storage into my app, its not a published app , im building for internal use in our company only…

till now ive just used a simple json backend which writes and reads the json file from the phones sdcard.
But now that the app is working nicely , id like to build in an online storage system becasue , 2 or more people might use the app on different devices at the same time but for the same customer its also more secure.

I thought about using firebase becasue its supposed to save localy and syncs to the online database at a later time for situations where you might have no data connection. … its important that it syncs even across restarts and preferably without maintanance (automatically in the background).

Firebase promises that in their advertisement. And i could also easily deploy a webapp (for the pc) with access to the same database.

now i would like to hear recommendations if and how i should implement it correctly in ionic (the most native approach with best funtionality/automatism).
if it doesnt work out , i would also opt for a sql database but i got no idea about that , preferably id like to use firestore because éase of use/maintanance… im a noob programmer and as a startup we just cannot aquire the expensive professional systems on the market so i have to make my own.

Thanx a lot for all help

1 post - 1 participant

Read full topic

App is crashing after adding admob free

HELP! How do I integrate native firebase google login with my capacitor app?

$
0
0

I am losing my mind. I have tried so many things.
First, I tried this:

I got the token from google and then I sent the token to my backend nodejs api where I verified the token and created a new token and passed back to the ionic app. This was working just fine on my local system on browser but then I realized that it does not open a native google login screen in emulator/phone but opens a browser popup. That looks horrible.

So I tried,

Didn’t work. Also, this seems to be not a very popular plugin, looking at the weekly downloads.

I am very new to ionic and mobile development in general. Could someone for the love of God please point to something that will see me all the way through implementing social login in my ionic app?

I am using Capacitor + angular + ionic 4.

2 posts - 2 participants

Read full topic

Ionic Selectable not work on Two-Way Binding

$
0
0

Ionic Selectable not working on Two-Way Binding.

  1. does Ionic Selectable work on Two-Way Binding in ionic 4? if yes, how to do???

            <ionic-selectable

             [(ngModel)]="user.city"

              [(items)]="cities"

              itemValueField="id"

              itemTextField="cityname"  

              [canSearch]="true"

              (onChange)="portChange($event)">

            </ionic-selectable>

3 posts - 3 participants

Read full topic

Build failures

$
0
0

I get build failures for commits that worked fine yesterday.

npm WARN tar ENOENT: no such file or directory, open ‘/Users/ionic/builds/project-0/node_modules/.staging/jsonfile-2c3a9210/package.json’

See Package build 7031045

1 post - 1 participant

Read full topic

Better build output from `ionic build`, number of errors is not clear

$
0
0

I’m working on an Ionic/Angular app migration from v3 to v5 and after creating a sample app and moving files around and adding updated dependencies got lots of build errors from ionic build command:

[ERROR] An error occurred while running subprocess ng.
ng run app:build exited with exit code 1.

While the errors are expected and I’m working my way through them, the number of errors left is not clear. The build output is not complete (when I scroll up I cannot reach the first error) and also ionic build (or rather ng run) doesn’t give me the exact number of errors so I can understand the progress.

How can I track number or errors from the build output?

1 post - 1 participant

Read full topic


Ionic 5: UI glitches in landscape mode

$
0
0

I am experiencing UI glitches when transitioning from portrait mode to landscape mode by flipping my physical phone around.

In portrait modus, everything looks fine.

In landscape mode, black blocks appear instead of the ion-input fields. Upon scrolling in landscape mode, the UI may re-appear, but it looks off.

I already tried "build > clean project "in Android Studio.

I took the code of the ionic Starter App:

<form [formGroup]="loginForm" (ngSubmit)="doEmailLogin()">
    <ion-list class="inputs-list" lines="full">
      <ion-item class="input-item">
        <ion-input
          type="email"
          placeholder="Email"
          formControlName="email"
          clearInput
          autocapitalize="off"
          inputmode="email"
        ></ion-input>
      </ion-item>
...

1 post - 1 participant

Read full topic

Firebase google analytics - web or native

$
0
0

Hi guys,

I have been using the the firebase analytics with Capacitor from Ionic native:
@ionic-native/google-analytics/ngx

With my web apps I use the firebase analytics built in with AngularFire which is awesome and logs all page views automatically.

Just wondering what people use and what is recommended. Should I keep using the package above or is it worth using the Angular version? Will I miss events if I use the web version?

1 post - 1 participant

Read full topic

Type 'CameraOriginal' is not assignable to type 'Provider'

$
0
0

I’ve upgraded my ionic 3 to ionic 5 and multiple ionic-native imports stopped working with the following error:

ERROR in src/app/app.module.ts:203:5 - error TS2322: Type 'CameraOriginal' is not assignable to type 'Provider'.
  Type 'CameraOriginal' is missing the following properties from type 'TypeProvider': apply, call, bind, prototype, and 5 more.

Found this comment that I need to add /ngx at the end of the import but this didn’t help, the error stays the same.

my new import is:

import { Camera } from '@ionic-native/camera/ngx';

Is that correct for the upgrade?
What else could be wrong here because this solution doesn’t help.

4 posts - 2 participants

Read full topic

Push Notifications with Image

$
0
0

I’m currently using Firebase to send my push notifications, using Capacitor to do so. In Firebase, you can send an ImageUrl over, which should show a small image inside the notification. Is there some more configuration within Capacitor to get this working correctly to show the image? I am receiving the notification, but it is not showing the image.

1 post - 1 participant

Read full topic

Ionic 5 - Ion back button does not Reload current tab page

$
0
0

Hi All

I have an app that is using tabs and every pop current page using the ion back button, the current page does not reload.

Any suggestion or solutions ?

Thanks

1 post - 1 participant

Read full topic

Capacitor Firebase analytics fails iOS

$
0
0

Trying to build iOS of my app that “should” use firebase analytics

It fails with

ArgumentError - Illformed requirement `"$IOS_FIREBASE_ANALYTICS_VERSION"

I installed it thus

npm install cordova-plugin-analytics
npm install @ionic-native/analytics-firebase
ionic cap sync

and the ionic cap sync command was successful.

1 post - 1 participant

Read full topic

Error: This constructor is not compatible with Angular Dependency Injection because its dependency at index 6 of the parameter list is invalid

$
0
0
ERROR Error: Uncaught (in promise): Error: This constructor is not compatible with Angular Dependency Injection because its dependency at index 6 of the parameter list is invalid.
This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.

Please check that 1) the type for the parameter at index 6 is correct and 2) the correct Angular decorators are defined for this class and its ancestors.
Error: This constructor is not compatible with Angular Dependency Injection because its dependency at index 6 of the parameter list is invalid.
This can happen if the dependency type is a primitive like a string or if an ancestor of this class is missing an Angular decorator.

Please check that 1) the type for the parameter at index 6 is correct and 2) the correct Angular decorators are defined for this class and its ancestors.

Don’t know why this error, didnt see it before and adding Injectable() doesnt help, my code is this:

import { Component, Injectable, OnInit } from '@angular/core';
import { UserService } from 'src/app/services/user/user.service';
import { map } from 'rxjs/operators';
import { User } from 'src/app/models/user';
import { Router } from '@angular/router';
import { ChatsService } from 'src/app/services/chats/chats.service';
import { UtilService } from 'src/app/services/util/util.service';

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

export class UsersPage implements OnInit {

  users: User[];
  uid: string;

  constructor(private userService: UserService,
    private router: Router, 
    private chatsService: ChatsService, 
    private util: UtilService) {
    this.util.doLoading('Please Wait...');
    this.userService.getAllUsers().snapshotChanges().pipe(
      map(changes => changes.map(c => ({
        key: c.payload.key, ...c.payload.val()
      }))
      )).subscribe(
        users => { this.users = users; console.log(users) })
    this.uid = this.userService.getUID();
  }

  openChat(key: string) {
    console.log("My key: ", key)
    this.chatsService.chatter = {
      uid: this.uid,
      interlocutorUID: key
    }
    this.router.navigateByUrl('/chat-view')
  }

  ngOnInit() {

  }

}

1 post - 1 participant

Read full topic


Empty result after execute first observable subscribe inside foreach to end

$
0
0

Hi,
I’m using ionic 3, angular 5,
I’m not sure what’s wrong with my code, I have the result always empty of observable inside foreach. Here’s my code:

articlepanier : Article[] = [];
		this.storage.get(TOKEN_KEY).then(token => {
		  let isExpired = helper.isTokenExpired(token);
		  if(!isExpired){  
			//foreach loop 
			this.cart.forEach((element, index) => {
			var article = new Article();
			article.artid = element.artid;
			article.artcode = element.artcode;
			//value of the sales unit quantity
			article.plvqteuv = element.amount;
			
			let data = {
				pricode: this.pricode,
				artcode: element.artcode
			};

			//use observable to return stock available in the database  
			//and change the value of the article.plvqtyisvalid by false value at each line 
			//if the quantity entered exceeds the quantity available
			this.cardProvider.stockbyarticle(data).subscribe((res: any) => {
			  if( res.ardstksoc < element.amount ){
				//change boolean status quantity is valid
				article.plvqtyisvalid = false;
			  }
			  
			  //method changes the contents of array
			  this.articlepanier.splice(index, 0, article);
			  
				console.log(this.articlepanier);
			});
				
		});

		//Here outside of foreach, I want the result of array after executing foreach (this.articlepanier) to be used in a if condition 
		//But articlepanier is always empty

		if(this.articlepanier.filter(c =>(c.plvqtyisvalid  == true).length > 0){
			//recording the card in database 
		}
	  
	  });

I want the result of observable inside foreach but this.articlepanier is always empty

1 post - 1 participant

Read full topic

Ionic in app browser before load event

$
0
0

ionic in app browser before load event is working fine in android but on iphone it is triger just first time after the browser appears on screen the before load event not workin
Note working fine on android

1 post - 1 participant

Read full topic

How to detect platform on ionic stencil project?

$
0
0

I’m using a ionic-stencil-starter-pwa project https://github.com/ionic-team/ionic-pwa-toolkit and I need to detect the platform because I will build the app using appflow for ios and android and I need to do some things only in a certain platform.

I don’t use cordova or angular but vanilla javascript.

I’ve found this https://ionicframework.com/docs/native/device and I’ve installed it but I have doubts how to use it.

import { Device } from '@ionic-native/device';

...
export class myClass {
  ....
  device: typeof Device;
...

but if I do “npm run build” i have this error:

[ ERROR ]  TypeScript: ./node_modules/@ionic-native/device/index.d.ts:1:35
           Cannot find module '@ionic-native/core' or its corresponding type declarations.

      L1:  import { IonicNativePlugin } from '@ionic-native/core';
      L2:  /**

I don’t really understand why this problem appears because I’ve installed the plugin like the documentation says

1 post - 1 participant

Read full topic

Ion-select does not show selected option when value is an object type

$
0
0

I am trying to use select-option values as objects.

 <ion-item>
    <ion-label>Choose</ion-label>
    <ion-select [value]="{key:'abc',value:'ABC'}">
      <ion-select-option value="{key:'abc',value:'ABC'}">ABC</ion-select-option>
      <ion-select-option value="{key:'pqr',value:'PQR'}">PQR</ion-select-option>
      <ion-select-option value="{key:'xyz',value:'XYZ'}">XYZ</ion-select-option>
    </ion-select>
  </ion-item>

When popup opens it does not show the selected value.

1 post - 1 participant

Read full topic

QR-Scanner - Stop unlimited scans

$
0
0

Hello everyone,

I have a problem with my QR scanner and I can’t get any further.Basically everything works finde. But it crashes my browser, because it sometimes does not stop scanning after it has scanned something (see picture 1 + 2). So I want him to scan something and after he has found something he should stop and not look for more Qr-Code.
Pic 1:
scans to often

Pic 2:

This is my code, hope you can help me:
.ts

  ngAfterViewInit() {
    this.videoElement = this.video.nativeElement;
    this.canvasElement = this.canvas.nativeElement;
    this.canvasContext = this.canvasElement.getContext('2d');
  }
  async startScan() {
    const stream = await navigator.mediaDevices.getUserMedia({
      video: { facingMode: 'environment'}
    });
    this.videoElement.srcObject = stream;
    this.videoElement.setAttribute('playsinline', true);
    this.videoElement.play();

    this.loading = await this.loadingCtrl.create({});
    await this.loading.present();
    requestAnimationFrame(this.scan.bind(this));
    this.ishidden = false;
  }

  async scan() {
    if (this.videoElement.readyState === this.videoElement.HAVE_ENOUGH_DATA) {
      if (this.loading) {
        await this.loading.dismiss();
        this.loading = null;
        this.scanActive = true;
      }
      this.canvasElement.height = this.videoElement.videoHeight;
      this.canvasElement.width = this.videoElement.videoWidth;

      this.canvasContext.drawImage(
        this.videoElement,
        0,
        0,
        this.canvasElement.width,
        this.canvasElement.height
      );

      const imageData = this.canvasContext.getImageData(
        0,
        0,
        this.canvasElement.width,
        this.canvasElement.height
      );

      const code = jsQR(imageData.data, imageData.width, imageData.height, {
        inversionAttempts: 'dontInvert'
      });
      console.log('code: ', code);

      if (code) {
        this.scanActive = false;
        this.scanResult = code.data;
        this.showQrToast();
      } else {
        if (this.scanActive) {
          requestAnimationFrame(this.scan.bind(this));
        }
        requestAnimationFrame(this.scan.bind(this));
      }
    } else {
      requestAnimationFrame(this.scan.bind(this));
    }
  }

  stopScan() {
    this.scanActive = false;
  }

my .html:

  <video #video [hidden]="!scanActive" width="50%"></video>
  <canvas #canvas hidden></canvas>
 
     <ion-button expand="full" (click)="stopScan()" color="danger" *ngIf="scanActive" [hidden]="ishidden">
       <ion-icon slot="start" name="close"></ion-icon>
       Stop Scanner
     </ion-button>
     
     <ion-button expand="full" (click)="saveQR()" color="danger" [hidden]="ishidden">
      <ion-icon slot="start" name="add-outline"></ion-icon>
      Save QR-Code
    </ion-button>

    <ion-button expand="full" (click)="reset()" color="primary" [hidden]="ishidden">
      <ion-icon slot="start" name="refresh-outline"></ion-icon>
      Reset QR-Scanner
    </ion-button>

     <ion-card *ngIf="scanResult">
       <ion-card-header>
         <ion-card-title>QR Code</ion-card-title>
       </ion-card-header>
       <ion-card-content>
         {{ scanResult }}
       </ion-card-content>
     </ion-card>
  

          <ion-button (click)="startScan()" shape="round"  color="primary" class="my-new-contact">
            <ion-icon slot="start" name="add-outline"></ion-icon>
            New Contact
          </ion-button>
  </ion-content>

4 posts - 2 participants

Read full topic

Viewing all 71263 articles
Browse latest View live


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