Git Product home page Git Product logo

hashedcontacts's Introduction

Hashed Contacts

Hashed Contacts is a drop-in iOS library that provides a wrapper around the Address Book frameworks designed to ensure the privacy of user data. It does this in two ways:

  1. Before access is ever made to the Address Book the user will first be prompted for permission
  2. Once access is granted the library returns hashed tokens representing the user's private data rather than the data itself.

These two steps do much to establish user trust with how you treat their data.

Installation

Copy the contents of the Source directory into your project. This will include the two main files DTSHashedContactsProvider.m and DTSHashedContactsProvider.h in addition to the localization files.

Add the AddressBook.framework to your project.

Supports iOS 4.0 and above

Replace the value of DTSHashSALT in DTSHashedContactsProvider.m and remove the warning.

Usage

See a full working example of how this library can be used by opening the included in this repository.

To use the library simply initialize an instance of the DTSHashedContactsProvider class. Note: You will need to retain a reference to this instance until you are done loading the user's data.

You may configure this in three ways:

  1. Choose the hashing method used via the hashingMethod property. Options are SHA1 and SHA512
  2. Specify the alert title via the alertTitle property
  3. Specify the alert message via the alertMessage property

A default value for the alert is provided based on the application display name.

Once that is done simply call the desired retrieval method to get your tokens.

[hashedContactsProvider emailTokensWithConfirmation:^(NSArray* tokens) {
//When permission given
} whenDeclined:^{
//When permission denied
}];

The result provided in tokens will look like this:

[@"eca7cf4a5981108abb6e2b9754c96b62e6c241db",@"a927a7e701521fd46b89db0162a05c1159cbd2aa"]

hashedcontacts's People

Contributors

crossforward avatar dtsdts2323 avatar hout avatar osigge avatar tonymillion avatar underscoredavidsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.