Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228535 articles
Browse latest View live

LaundryService App built with ionic1

$
0
0

Hi There,

I would like to suggest some additional information regarding laundry pickup and delivery app development. If anyone want to develop on demand laundry service app then, It would be very simple with readymade on demand mobile app solutions,

In recent days, there are many more mobile app development companies providing well-designed laundry delivery mobile app-based solutions. You can easily purchase your app solution from them and personalize it with respect to your needs. It will be the best way to launch your on-demand laundry service in a hassle-free manner.


Ionic 4 virtual scroll header doesn't group by last names

$
0
0

hey guys so I am making a Contacts page where the last names are grouped based on the first letter. All last names beginning with A are grouped under ‘A’, etc. I have the problem where that isn’t the case. It creates a header for all of them. If I have two people with the last name of ‘Smith’ then both of them will have the header ‘S’.
here is my html

<ion-content>
  <ng-container *ngIf="contactList$">
    <ion-virtual-scroll [items]="contactList" [ngClass]="{ dinamicBorders: results }" [headerFn]="headerFn">
      <ion-item-divider *virtualHeader="let header">
        {{ header }}
      </ion-item-divider>
      <ion-item *virtualItem="let c" [ngClass]="{ 'hide-item': c.empty }">
        <ion-thumbnail slot="start">
          <img [src]="c.profilePicture" />
        </ion-thumbnail>
        <ion-label position="stacked">{{ c.lastNames }}, {{ c.firstNames }} - {{ c.specialty }}</ion-label>

        <ion-label position="stacked">{{ c.hospitals[name] }}</ion-label>
      </ion-item>
    </ion-virtual-scroll>
  </ng-container>

and here is contact.ts

  public headerFn(record: Contact, recordIndex: number, records: Contact[]): string {
    let i: string;
    const char = record.lastNames[0].toUpperCase().replace('À', 'A');
    if (char !== i) {
      i = record.lastNames[0];
      return record.lastNames[0].toUpperCase();
    } else {
    return null;
    }
  }

Resize / DOM Events / "Style change" triggers ngif?

$
0
0

I noticed some major performance issues in my ionic project, so i checked what was going on, and found out that my *ngIf is triggered every time i click somewhere or the window is resized. I setup a new clean ionic project and it also seems to happen there. I re-created the same scenario in a blank angular project without ionic, and it doesn’t happen there, so it might be an ionic-only issue.

Sample Code:
app.component.html

<div *ngIf="test()"></div>

app.component.ts:

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html'
})
export class AppComponent {
  constructor(
    private platform: Platform,
    private splashScreen: SplashScreen,
    private statusBar: StatusBar
  ) {
    this.initializeApp();
  }

  initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      this.splashScreen.hide();
    });
  }

  test(){
    console.log('change');
  }
}

This is the browsers output, notice that the log message was called 180+ times after resizing the window…
What is the issue here? Is it a bug? Is it expected behavior? It doesn’t seem to happen in a blank angular project.

I read some things about using changeDetection with OnPush, but then my Observables and BehaviorSubjects from my Services aren’t working anymore

Ionic Version:
Ionic CLI : 5.0.0 (C:\Users\admin\AppData\Roaming\npm\node_modules\ionic)
Ionic Framework : @ionic/angular 4.4.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

Problem with Scroll in iOS 10.2 (Auto scrolling TOP not intentional)

$
0
0

@fsarmento Did you manage to solve this? I’m experiencing the same issue with ionic 4 and iOS 12.2 and it’s driving me crazy.

@mhartington There are rare use cases when you just need to use an iframe. E.g. I’m combining an existing shop with an EAN Barcode Scanner. No need to reimplement the shop but shopping still works. And “fast” shopping also works thanks to the scanner.

Developer needed to break down UI into Ionic 4 for iPhone mobile app templates

$
0
0

Hello

Being an experienced creative developer who can code, draw, and design with many perspectives and bring out a positive output.
You can expect the best standard quality codes from me.

To know more you can add me on Skype and Gmail.
Skype id is live:bellastone_5
Email address : bellastone.mil@gmail.com

Regards
Bella Stone

Pull App Code from Appflow repository

$
0
0

I have a new Macbook and would like to get the latest version of an existing app from the Appflow repository. Do I need to start the app in my file system first before I do ionic link | git pull ionic master? And what do I have to delete for this command to work? I get the error “fatal: refusing to merge unrelated histories”.

swipeLeft(), swipeRight() events no longer working in ionic 4

$
0
0

The easiest way is to:
Install hammer js.
And add this line into the src/main.ts
import ‘hammerjs’;

Adding input dat ato existed list

$
0
0

Hi, I have data , I am displaying dat through ngFor, But whenever user gives reply it need to add same data to forloop and need to display how can we do , please help me. Thanks. I should not reload the page again to see latest message.


Ionic and Emberjs

$
0
0

How easy would it be to implement ember JS into IONIC just as vue and react has been implemented

I need some guidance but am interested i’m implementing it if knowledge permits

Nonetype' object has no attribute 'decode' error when i upload the image to database

$
0
0

I am new to ionic4/angular4.i need to upload the profile pic to database.i wrote code but I don’t know whether it is correct or not and when I am uploading it I am getting the above-mentioned error. backend he is using Django and backend is correct only other requests is accepting
.ts

getPicture() {
const options: CameraOptions = {
  quality: 70,
  destinationType: this.camera.DestinationType.FILE_URI,
  encodingType: this.camera.EncodingType.JPEG,
  mediaType: this.camera.MediaType.PICTURE,
  allowEdit: false,
  sourceType: this.camera.PictureSourceType.CAMERA,
  correctOrientation: true,
  saveToPhotoAlbum: false
};

this.camera.getPicture(options).then(
  imageData => {
    // imageData is either a base64 encoded string or a file URI
    // If it's base64 (DATA_URL):
    this.image = this.sanitizer.bypassSecurityTrustUrl(
      "data:Image/*;base64" + imageData
    );
    // this.imageURI = imageData;
    this.profileService
      .postInfluencerProfile(this.image, null, null)
      .subscribe(
        response => {
          console.log(response);
        },
        (error: MavinError) => {
          if (error instanceof NotFoundError) {
            alert("Not found");
          } else {
            console.log(error);
          }
        }
      );
  },
  err => {
    // Handle error
  }
);

service.ts

postInfluencerProfile(
    profilePic: File,
    name: string,
    emailId: string
  ): Observable<any> {
    const url = "****************";
    const apiKey = "************";
    const sessionID = localStorage.getItem("sessionID");
    const formdata = new FormData();
    formdata.append("file", profilePic);
    console.log(formdata);
    const loginContext = {
      user_agent:
        "Dalvik/2.1.0 (Linux; U; Android 6.0.1; Nexus Player Build/MMB29T)"
    };
    const postData = {
      api_key: apiKey,
      session_id: sessionID,
      profile_picture: profilePic,
      display_name: name,
      email_id: emailId
    };
    const httpOptions = {
      headers: new HttpHeaders({
        "Content-Type": "multipart/form-data;"
      })
    };
    // delete httpOptions.headers['Content-Type'];
    console.log(postData);
    return this.http.post(url, postData, httpOptions);
  }

Use cloud functions from firebase

$
0
0

Hello guys, i need how can use cloud functions but without deploy, because another person do this part.
i need just use in my app ionic v4
Thanks

Ioinc 4 - form and submit button

$
0
0

Same problem here. Solved with the click event on the button.

[ionic v3] Object(...) is not a function at CameraPreview.startCamera

$
0
0

Hi,

I’m developing an ionic 3 application in which I need to show the camera interface inside the app screen and camera-preview seems to be the right and only solution to go with at this moment. However, when I trigger the startCamera function, I always get the error ’ Object(…) is not a function at CameraPreview.startCamera’. Any help would be much appreciated.

Here are the steps I used for the installation:

  1. From CLI:
    ionic cordova plugin add https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview.git
    npm install @ionic-native/camera-preview

2.Add to the provider list in module.ts file

import { CameraPreview } from '@ionic-native/camera-preview/ngx';
.....
providers: [  
    CameraPreview, ...
]

Below is the page where I would use the plugin:

import { Component, NgZone } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { CameraPreview, CameraPreviewPictureOptions, CameraPreviewOptions, CameraPreviewDimensions } from '@ionic-native/camera-preview/ngx';

@Component({
  selector: 'page-submitdata2',
  templateUrl: 'submitdata2.html',
})
export class Submitdata2Page {
  
  public getWidth: number;
  public getHeight: number;
  public calcWidth: number;
  cameraPreviewOpts: CameraPreviewOptions =
    {
      x: 40,
      y: 100,
      width: 220,
      height: 220,
      toBack: false,
      previewDrag: true,
      tapPhoto: true,
      camera: this.cameraPreview.CAMERA_DIRECTION.BACK
    }
  constructor(
    public cameraPreview: CameraPreview, private zone: NgZone,
    public navCtrl: NavController, public navParams: NavParams) {

    this.zone.run(() => {
      this.getWidth = window.innerWidth;

      this.getHeight = window.innerHeight;
    });
    console.log('width', this.getWidth);

    this.calcWidth = this.getWidth - 80; 

    console.log('calc width', this.calcWidth);
    }
  ionViewDidLoad() {
    console.log('ionViewDidLoad Submitdata2Page');
  }
  startCamera() {
    debugger
    this.cameraPreview.startCamera(this.cameraPreviewOpts).then(
      (res) => {
        console.log(res)
      },
      (err) => {
        console.log(err)
      });
  }


  stopCamera() {
    this.cameraPreview.stopCamera();
  }
  takePicture() {
    this.cameraPreview.takePicture()
      .then((imgData) => {
        (<HTMLInputElement>document.getElementById('previewPicture')).src = 'data:image/jpeg;base64,' + imgData;
      });
  }
  SwitchCamera() {
    this.cameraPreview.switchCamera();
  }
  showCamera() {
    this.cameraPreview.show();
  }
  hideCamera() {
    this.cameraPreview.hide();
  }
}

The HTML:

<ion-header>
    <ion-navbar>
        <ion-title>Preview Page</ion-title>
    </ion-navbar>
</ion-header>
<ion-content padding>

    <h5>This is camera Preview Application..</h5>

    <div class="displaybottom">
        <button ion-button (click)="startCamera()"> Start Camera</button>
        <button ion-button (click)="stopCamera()"> Stop Camera</button>

        <button ion-button (click)="takePicture()"> Take Picture Camera</button>

        <button ion-button (click)="SwitchCamera()"> Switch  Camera</button>

        <button ion-button (click)="showCamera()"> Show Camera</button>

        <button ion-button (click)="hideCamera()"> Hide Camera</button>
    </div>

    <div class="pictures">
        <p><img id="previewPicture" width="200" /></p>
        <!--<p><img id="originalPicture" width="200"/></p>-->
    </div>

</ion-content>

My Development Enviroment:

Capture

"export 'ICON_PATHS' was not found in 'ionicons/icons'

$
0
0

This worked for me:

npm install ionicons@4.5.9-1 --save-dev

Network events not working

$
0
0

Hi,

On Ionic 4, the events are never fired,

@ionic-native/core”: “^5.9.0”,
@ionic-native/network”: “^5.9.0”,
“cordova-plugin-network-information”: “^2.0.2”,

this.network.onDisconnect().subscribe(() => {
  console.log('network was disconnected :-(');
});

this.network.onConnect().subscribe(() => {
  console.log('network connected!');
  // We just got a connection but we need to wait briefly
   // before we determine the connection type. Might need to wait.
  // prior to doing any api requests as well.
  setTimeout(() => {
    if (this.network.type === 'wifi') {
      console.log('we got a wifi connection, woohoo!');
    }
  }, 3000);
});

Threejs for Ionic4 possible?

$
0
0

I have tried it but it only renders for a split second and then just returns a white blank screen… Any help on this will be much appreciated?

Threejs for Ionic4 possible?

$
0
0

i have the same problem.pls help me

500 (Internal Server Error)

$
0
0

I had CORS issue and added proxy to ionic.config.json
Now I get this error

{"headers":{"normalizedNames":{},"lazyUpdate":null},"status":500,"statusText":"Internal Server Error","url":"http://localhost:8100/api","ok":false,"name":"HttpErrorResponse","message":"Http failure response for http://localhost:8100/api: 500 Internal Server Error","error":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<meta charset=\"utf-8\">\n<title>Error</title>\n</head>\n<body>\n<pre>Error: getaddrinfo ENOTFOUND myurl.com myurl.com:443<br> &nbsp; &nbsp;at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:57:26)</pre>\n</body>\n</html>\n"}

Here is the link to my post
What does this error mean and what can I do to rectify it?

Network events not working

$
0
0

Even i felt network events are not firing,
Just console the this.network.type you will get to know which are all the types will come…

I have used network events in ionic 4 app with the same way its firing in actual device.

When in ionic 3 type is cell_4g but in ionic 4 type is coming as just 4g

In the browser, event is not firing

Ionic 4 Cordova - Run Android Firebase error all of a sudden

$
0
0

couldn’t find that file path.
ionic 3 project.

Viewing all 228535 articles
Browse latest View live