Contacts
This commit is contained in:
@@ -87,6 +87,9 @@ ionic generate component market-messages
|
||||
ionic generate service help-data
|
||||
ionic generate component job-details
|
||||
|
||||
ionic generate service contacts-data
|
||||
|
||||
|
||||
https://masteringionic.com/blog/working-with-capacitor-googlemaps-in-ionic
|
||||
ionic generate interface interfaces/location
|
||||
ionic generate interface interfaces/marker
|
||||
@@ -112,6 +115,8 @@ ionic generate service familysuggest-pending
|
||||
|
||||
|
||||
npm i @capacitor/camera @capacitor/filesystem
|
||||
npm i @capacitor-community/contacts
|
||||
|
||||
|
||||
https://devdactic.com/ionic-image-upload-capacitor
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ContactsDataService } from './contacts-data.service';
|
||||
|
||||
describe('ContactsDataService', () => {
|
||||
let service: ContactsDataService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(ContactsDataService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
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
|
||||
}}).then( result=>{
|
||||
console.log(result);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user