Phone call logs/ call history in Ionic

How can we use callsPlugin in our app?

Is there another way to show call history/ call log in android device?

any version of ionic will be preferable.

What is this? Is there a link?

check this link

So this doesn’t work in Ionic why?

Thats the issue i need to solve.

I installed this plugin. and added this given tutorial code to my controller.

then it was showing me an error which is “calls not defined”, then I tried to give the calls parameter in app.js as well as in controller.js but still it showing me an Injector error.

So I need a simple step by step guide to use this plugin.

Hi @atul2889, did you solve the problem?

Yes i have solved in ionic 4

Can you share the code, please?

Please check this below reference link. Hope this link will help you.

Good luck

I already checked it but it’s not working!

Dear its working for me.

Please check this below code.

import { Component } from '@angular/core';
import { Platform } from '@ionic/angular';
import { CallLog, CallLogObject } from '@ionic-native/call-log/ngx';
import { CallNumber } from '@ionic-native/call-number/ngx';
  selector: 'app-home',
  templateUrl: '',
  styleUrls: [''],
export class HomePage {
  filters: CallLogObject[];
  recordsFound: any;
  recordsFoundText: string;
    private callLog: CallLog, 
    private callNumber: CallNumber,
    private platform: Platform
    ) {
    this.platform.ready().then(() => {
      this.callLog.hasReadPermission().then(hasPermission => {
        if (!hasPermission) {
          this.callLog.requestReadPermission().then(results => {
            .catch(e => alert(" requestReadPermission " + JSON.stringify(e)));
        } else {
          this.getContacts("type", "1", "==");
        .catch(e => alert(" hasReadPermission " + JSON.stringify(e)));
    getContacts(name, value, operator) {
      if(value == '1'){
        this.listTyle = "Incoming Calls from yesterday";
      }else if(value == '2'){
        this.listTyle = "Ougoing Calls from yesterday";
      }else if(value == '5'){
        this.listTyle = "Rejected Calls from yesterday";
      //Getting Yesterday Time
      var today = new Date();
      var yesterday = new Date(today);
      yesterday.setDate(today.getDate() - 1);
      var fromTime = yesterday.getTime();
      this.filters = [{
        name: name,
        value: value,
        operator: operator,
      }, {
        name: "date",
        value: fromTime.toString(),
        operator: ">=",
        .then(results => {
          this.recordsFoundText = JSON.stringify(results);
          this.recordsFound = results;//JSON.stringify(results);
        .catch(e => alert(" LOG " + JSON.stringify(e)));
      this.callNumber.callNumber(number, true)
      .then(res => console.log('Launched dialer!', res))
      .catch(err => console.log('Error launching dialer', err));


      Ionic 4 Call Log Demo
          <ion-col size="4">
              <ion-button (click)="getContacts('type','1','==')" size="small" color="success">Incoming</ion-button>
          <ion-col size="4">
              <ion-button (click)="getContacts('type','2','==')" size="small" color="warning">Outgoing</ion-button>
          <ion-col size="4">
              <ion-button (click)="getContacts('type','5','==')" size="small" color="danger">Rejected</ion-button>
    <ion-card  *ngFor="let contact of recordsFound" (click)="callThisNumber(contact['number'])">
        <ion-card-header  *ngIf="contact['name']" >

I used this code exactly same but it was only displaying this:


Do you have any other info?

yes i complete this module in angular