import { Injectable } from '@angular/core';
import {Contacts } from "@capacitor-community/contacts";
import { Plugin} from "@capacitor/core";
//const { Contacts } = Plugins;

import { isPlatform } from "@ionic/angular";

@Injectable({
  providedIn: 'root'
})
export class ContactsDataService {

  constructor() { }


  async refeshContacts(){

      if (isPlatform('android') || isPlatform('iphone') || isPlatform('ios')){
          //return;
      }
      else{
          return;
      }
    Contacts.getContacts({projection: {
        name: true,
        phones: true,
        image: true,
        emails: true
      }}).then( result=>{
         console.log(result);
    });
  }
}
