0.0.0 • Published 6 years ago
acran-cordova-plugin-contact-modal-debug v0.0.0
cordova-plugin-contact-modal
Open the phone's "create contact" modal with some pre-filled values
Install
$ cordova plugin add https://github.com/ajoslin/cordova-plugin-contact-modal --save
Usage
// The plugin expects a contact in the format provided by vcards-js module
var VCard = require('vcards-js')
var vcard = VCard()
document.addEventListener('deviceready', function () {
var contactModal = window.cordova.plugins.contactModal
contactModal.createContact(vcard, onComplete)
})
function onComplete () {
// Will be called once the modal is successfully closed.
}
API
window.cordova.plugins.contactModal.createContact(vcard, [callback])
vcard
Required
Type: object
Matches the format of a vcards-js object.
Only the following subset of vcard properties are supported. Pull requests are welcome for more properties.
firstName
lastName
workPhone
cellPhone
directPhone
workEmail
externalEmail
organization
title
socialUrls
(only ios)facebook
(only ios)instagram
(only ios)twitter
(only ios)linkedIn
(only ios)
photo
(only base64 supported, only ios)
callback
Type: function([error])
Called once the native modal is closed.
Takes an error parameter, which will be given in if the modal failed to open.
License
MIT © Andrew Joslin
0.0.0
6 years ago