{"title":"Protect Your Users' Privacy With DTSHashedContacts","html_url":"https://deallocatedobjects.com/posts/protect-your-users-privacy-with-dtshashedcontacts","source_url":"https://github.com/crossforward/HashedContacts","markdown_content":"As I'm sure many readers have heard, there has been [some](http://mclov.in/2012/02/08/path-uploads-your-entire-address-book-to-their-servers.html) [public](http://blog.path.com/post/17274932484/we-are-sorry) [outcry](http://www.macrumors.com/2012/02/15/congress-weighs-in-on-ios-apps-collecting-address-book-and-other-personal-data/) lately on the subject of iOS apps accessing the Address Book contacts of a their users and then sending the whole lot of them off to their servers, to accomplish their \"friend matching\" features.\r\n\r\nMany companies have [already](http://blog.path.com/post/17274932484/we-are-sorry) [corrected](http://www.pcmag.com/article2/0,2817,2400154,00.asp) the error in their ways, (partially), and [even Apple has stated](http://www.macrumors.com/2012/02/15/apple-to-require-explicit-permission-for-ios-apps-accessing-address-book-data/) that a future iOS release will lock down Address Book access, in the same way that permission is required to access a user's geographic location now.\r\n\r\nIn the meantime however, if you'd like a quick, easy and safe way to build a \"find my friends\" type of feature into your app, I'd recommend looking at [`DTSHashedContacts`](https://github.com/crossforward/HashedContacts).\r\n\r\nIt's is a drop-in iOS library that provides a wrapper around the Address Book frameworks designed to ensure the privacy of user data. Before access is ever made to the Address Book the user will first be prompted for permission with a customizable `UIAlertView` prompt. Once access is granted the library returns hashed tokens representing the user's private data rather than the data itself.\r\n\r\nHere's what it looks like to use it:\r\n\r\n``` objc\r\n[hashedContactsProvider emailTokensWithConfirmation:^(NSArray* tokens) {\r\n//When permission given\r\n} whenDeclined:^{\r\n//When permission denied\r\n}];\r\n```\r\n\r\n[Read more about `DTSHashedContacts` on Github](https://github.com/crossforward/HashedContacts)","html_content":"<p>As I’m sure many readers have heard, there has been <a href=\"http://mclov.in/2012/02/08/path-uploads-your-entire-address-book-to-their-servers.html\">some</a> <a href=\"https://web.archive.org/web/20120216225825/http://blog.path.com/post/17274932484/we-are-sorry\">public</a> <a href=\"http://www.macrumors.com/2012/02/15/congress-weighs-in-on-ios-apps-collecting-address-book-and-other-personal-data/\">outcry</a> lately on the subject of iOS apps accessing the Address Book contacts of a their users and then sending the whole lot of them off to their servers, to accomplish their “friend matching” features.</p>\n\n<p>Many companies have <a href=\"https://web.archive.org/web/20120216225825/http://blog.path.com/post/17274932484/we-are-sorry\">already</a> <a href=\"http://www.pcmag.com/article2/0,2817,2400154,00.asp\">corrected</a> the error in their ways, (partially), and <a href=\"http://www.macrumors.com/2012/02/15/apple-to-require-explicit-permission-for-ios-apps-accessing-address-book-data/\">even Apple has stated</a> that a future iOS release will lock down Address Book access, in the same way that permission is required to access a user’s geographic location now.</p>\n\n<p>In the meantime however, if you’d like a quick, easy and safe way to build a “find my friends” type of feature into your app, I’d recommend looking at <a href=\"https://github.com/crossforward/HashedContacts\"><code>DTSHashedContacts</code></a>.</p>\n\n<p>It’s is a drop-in iOS library that provides a wrapper around the Address Book frameworks designed to ensure the privacy of user data. Before access is ever made to the Address Book the user will first be prompted for permission with a customizable <code>UIAlertView</code> prompt. Once access is granted the library returns hashed tokens representing the user’s private data rather than the data itself.</p>\n\n<p>Here’s what it looks like to use it:</p>\n<figure class=\"code\" data-lang=\"objective-c\"><figcaption><span class=\"lang\">Objective-C</span></figcaption><pre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">[hashedContactsProvider </span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">emailTokensWithConfirmation:</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">^</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">(</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">NSArray</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">*</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> tokens) {</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\">//When permission given</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">} </span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">whenDeclined:</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">^</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">{</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#6A737D;--shiki-dark:#6A737D\">//When permission denied</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">}];</span></span></code></pre></figure>\n<p><a href=\"https://github.com/crossforward/HashedContacts\">Read more about <code>DTSHashedContacts</code> on Github</a></p>","created_at":"2013-11-16T05:10:25.573Z","updated_at":"2013-11-16T05:10:25.573Z"}