Getting Started

The Contacts framework provides API to access the user’s contact information. Because most apps read contact information without making any changes, this framework is optimized for thread-safe, read-only usage.

First of all, you need to enable Contacts API inside the plugin settings and specify the NSContactsUsageDescription plist key. NSContactsUsageDescription lets you describe the reason your app accesses the user’s contacts. When the system prompts the user to allow access, this string is displayed as part of the alert.

Note: To protect user privacy, an iOS app linked on or after iOS 10.0, and that accesses the user’s contacts, must statically declare the intent to do so. Include the NSContactsUsageDescription key in your app’s Info.plist file and provide a purpose string for this key. If your app attempts to access the user’s contacts without a corresponding purpose string, your app exits.

See the image below:

Before using any Contacts API, you must requests access to the user's contacts. Users are able to grant or deny access to contact data on a per-application basis. The user will only be prompted the first time access is requested, any subsequent ISN_CNContactStore calls will use the existing permissions. If this method is not used, ISN_CNContactStore may block your application while the user is asked for access permission.

namespace SA.IOSNative.Contacts 
...
var status = ISN_CNContactStore.GetAuthorizationStatus(ISN_CNEntityType.Contacts);
if(status == ISN_CNAuthorizationStatus.Authorized) {
    Debug.Log("Contacts Permission granted");
} else {
    ISN_CNContactStore.RequestAccess(ISN_CNEntityType.Contacts, (result) => {
        if (result.IsSucceeded) {
            Debug.Log("Contacts Permission granted");
        } else {
            Debug.Log("Contacts Permission denied");
        }
    });
}