Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70860

Making cordova-plugin-contacts work in Ionic2

$
0
0

@longliveajay wrote:

For some reason my application fails to read contacts from user's phone:

get(){
Contacts.find(['*']).then((lists) => {
this.contacts = lists;

    let contentHeader: Headers = new Headers({"Content-Type": "application/json"});
    let url = `http://localhost:8080/api/contacts`;
    return this._http.post(url, lists, {'headers': contentHeader});
});

}

The template

<button type="button" (click)="get()">Contacts</button>
<ion-list>
    <ion-item *ngFor="let contact of contacts">{{contact.displayName}}</ion-item>
</ion-list>

I can't understand why it fails to read contacts. Any help ?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70860

Trending Articles



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