@nacrejs/contacts
v0.0.1
Published
Nacre 的通讯录选择器:让用户从通讯录里选联系人,不需要通讯录权限。装了才有 CNContactPickerViewController
Readme
@nacrejs/contacts
A capability package for Nacre, a JavaScript runtime for iOS apps: letting the user pick contacts with the system contact picker. It provides CNContactPickerViewController and CNContact. The app has it only if the project installs this package.
The system picker gives the app only the contacts the user picks, so no contacts permission is needed.
Install
In a Nacre project, two steps.
1. Install the package.
npm install @nacrejs/contacts2. Bring in its types at the top of the entry file.
/// <reference types="@nacrejs/types" />
/// <reference types="@nacrejs/contacts" />Effect: after you regenerate ios/ and rebuild, the app includes this capability, and typeof CNContactPickerViewController !== 'undefined' is true.
Without the package, its classes don't exist: reading one throws ReferenceError, and type checking reports it first.
For how to use it, see Contact picker. For all capability packages, see Core and capability packages.
License
FSL-1.1-MIT, see LICENSE.md.
