Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

com.prakash.pickcontact

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.prakash.pickcontact

Cordova ContactPicker Plugin

  • 3.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

ContactPicker plugin for Cordova / PhoneGap

This Plugin is inspired from ContactChooser plugin here

This Plugin brings up a native iOS or Android contact-picker overlay, accessing the addressbook and returning the selected contact's name, phone number and email, also new contact can be added.

Usage

This has been successfully tested from Cordova 2.2.0 through to version 3.1.0.

Example Usage:

  1. Pick contact
window.plugins.ContactPicker.chooseContact(function(contactInfo) {
//to get all phones numbers
    for (var i = 0; i < contactInfo.phones.length; i++) {
	     alert(contactInfo.phones[i]);
    };
    alert(contactInfo.displayName + " " + contactInfo.selectedPhone + " " + contactInfo.phones[0] + " " + contactInfo.email);
});

The method which will return a JSON. Example:

{
    displayName: "John Doe",
    email: "john.doe@mail.com",
    selectPhone: "(555) 555-5555",
    phones: ["numbers"]
}
  1. Add new contact
//you can prefilled variable by add contact object 
var contact = {};
contact.displayName = "displayName";
contact.email = "email";
contact.phoneNumber = "phoneNumber";
window.plugins.ContactPicker.addContact(contact, function(contactInfo) {
    alert(contactInfo.displayName + " " + contactInfo.phones[0] + " " + contactInfo.email);
});
//or you can leave it empty by ad passing null in parameter
window.plugins.ContactPicker.addContact(null, function(contactInfo) {
    alert(contactInfo.displayName + " " + contactInfo.phones[0] + " " + contactInfo.email);
});

Installation

for Cordova >= 3.0.0

phonegap local plugin add https://github.com/hazemhagrass/ContactPicker.git
cordova plugin add https://github.com/hazemhagrass/ContactPicker.git

for Cordova >= 5.0.0

cordova plugin add com-badrit-contactpicker

MIT Licence

Copyright 2013 Monday Consulting GmbH

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Keywords

FAQs

Package last updated on 02 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc