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

cordova-plugin-contacts-save

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-contacts-save

Cordova Contacts Save Plugin

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

cordova-plugin-contacts-save

npm version MIT Licence

This plugin saves the contacts into the device.

Installation

cordova plugin add cordova-plugin-contacts-save

Supported Platforms

  • iOS

Dont forget to add NSContactsUsageDescription to your plist.

You can add this in your config.xml.

<platform name="ios">
  ...
  <edit-config file="*-Info.plist" mode="merge" target="NSContactsUsageDescription">
    <string>Used to save business cards</string>
  </edit-config>
  ...
</platform>

Usage

// define contacts
var contacts = [
  {
    givenName: "Steve",
    familyName: "Jobs",
  },
];

// set default store container
var container = "";

// save contacts
window.ContactsSave.saveContacts(
  contacts,
  container,
  (cookies) => {
    // contacts saved
  },
  (error) => {
    // error: NO_CONTACTS or NO_PERMISSON
  }
);

Types

export interface CNMutableContact {
  namePrefix?: string;
  givenName?: string;
  familyName?: string;
  organizationName?: string;
  jobTitle?: string;
  postalAddresses: CNLabeledValue<"home" | "work" | "other", CNPostalAddress>[];
  phoneNumbers: CNLabeledValue<
    "home" | "work" | "mobile" | "homeFax" | "workFax" | "otherFax" | "other",
    CNPhoneNumber
  >[];
  emailAddresses: CNLabeledValue<"home" | "work" | "other", string>[];
  urlAddresses: CNLabeledValue<"home" | "work" | "other", string>[];
  imageData?: string;
  note?: string;
}

export interface CNLabeledValue<L, V> {
  label?: L;
  value: V;
}

export interface CNPhoneNumber {
  stringValue?: string;
}

export interface CNPostalAddress {
  street?: string;
  city?: string;
  state?: string;
  postalCode?: string;
  ISOCountryCode?: string;
  country?: string;
}

Keywords

FAQs

Package last updated on 28 Jul 2020

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