Protected
_nativeReadonly
ContactProtected
preProtected
createThis function adds a contact to contact list with specified properties. You need check Permissions.android#contact before adding contact.
import Contacts from '@smartface/native/device/contacts';
const myContact = new Contacts.Contact({
firstName: 'Smartface',
namePrefix: 'Mr.',
lastName: 'Team',
urlAddresses: ["https://smartface.io"],
phoneNumbers: ["+16506173265"],
emailAddresses: ["info@smartface.io"],
addresses: ["3790 El Camino Real # 1022 Palo Alto CA, 94306,United States"]
});
Contacts.add({
contact: myContact,
onSuccess: () => {
console.log("Success");
},
onFailure: () => {
console.log("Failure");
}
});
0.1
This function shows contact list. It allows user to pick a data from the list.You need check Permissions.android#contact before picking contact.
import Contacts from '@smartface/native/device/contacts';
Contacts.pick({
page : myPage,
onSuccess : function(contact){
console.log("Successfully picked");
},
onFailure : function(e){
console.log("Something went wrong");
}
});
0.1
This function returns a contact array.You need check Permissions.android#contact before using this function.
import Contacts from '@smartface/native/device/contacts';
Contacts.fetchAll({
onSuccess : function(contacts){
var count = contacts.length;
},
onFailure : function(error){
console.log("Message : " + error);
}
});
getAll
0.1
This function searches contacts by given phone number.You need check Permissions.android#contact permission.
import Contacts from '@smartface/native/device/contacts';
Contacts.getContactsByPhoneNumber("5555555555",{
onSuccess : function(contacts){
console.log("Successfully found ", contacts);
},
onFailure : function(error){
console.log("Something went wrong");
}
});
4.3.0
Generated using TypeDoc
Since
0.1 This class allows user to add a contact to contact list or to select a contact from list.
Example