Header spec for FBSession + POR for next rev iOS SDK

Summary:
This diff contains a header-spec for FBSession, as well as
a header and POR for the next rev of the sdk

Test Plan: n/a

Reviewers: mmarucheck, vijaye, gregschechte, ekoneil

Reviewed By: vijaye

Differential Revision: https://phabricator.fb.com/D424291
Adapted earlier build script to create a .framework and a .pkg.

Summary:
This extends the build_facebook_ios_sdk_static_lib.sh to build
a .framework file, and adds a script to package that and the
templates we will add into an installer .pkg.

These scripts are used by the SDK team to generate binaries
for distribution, and the build_framework script may be
useful to developers who clone the github repository and
want to build the framework with their own local changes.

Also added new headers to the build, and distinguish between
public and project header files.  Since existing projects do not
currently use the .framework, they continue to include headers
directly and are unaffected by public/project.  The legacy
headers are available for copying in the framework download
under FBiOSSDK.framework/Versions/A/LegacyHeaders.

Test Plan:
- Run both scripts
- Verify setup installs a sample template that XCode picks up.
- Verify that the .framework is usable in Vijaye's sample.

Reviewers: jacl, vijaye

Reviewed By: vijaye

CC: gregschechte, security-diffs@lists, yariv

Differential Revision: https://phabricator.fb.com/D431587

Task ID: 981284
Header spec for FBRequest, including migration approach

Summary:
This diff contains a header for style and design review for
FBRequest, as well as for the approach to incremental
migration.

Test Plan: N/A

Reviewers: mmarucheck, vijaye, gregschechte, ekoneil, toddkrabach

Reviewed By: vijaye

CC: yariv, suhas

Differential Revision: https://phabricator.fb.com/D429749
Quick fix to ignore expected deprecation warnings
Profile picture control

Summary: Adds a profile picture control with graph api accepted picture types (square, small, normal, large)

Test Plan:
Create a sample app and use the profile picture control on a bunch of user ids
Change the type and userid at runtime and verify that the profile image updates appropriately

Reviewers: jacl, mmarucheck, leon, toddkrabach

Reviewed By: jacl

CC: gregschechte, yariv, greg

Differential Revision: https://phabricator.fb.com/D433395
Rename sample -> samples

Differential Revision: https://phabricator.fb.com/D434580
Sample app that uses Profile picture view

Summary:
Sample app exercising the FBProfilePictureView.  Sets userid and changes size at runtime.

* Note:: Also added initWithFrame & initWithCoder in ProfilePictureView.  When used in a NIB, the UIView doesn't get the init message - but instead it gets the initWithCoder.  This interestingly doesn't call init.  So I brought back the "self-initialize" designated initializer.

Test Plan: Verify that the app works correctly

Reviewers: jacl, mmarucheck, leon, toddkrabach

Reviewed By: leon

CC: gregschechte, security-diffs@lists

Differential Revision: https://phabricator.fb.com/D434684
Merge URL connection classes

Summary:
Vijaye checked in a URL wrapper for the profile picture control.  I had
written one for FBRequest.  This merges the two, and changes existing
code to use the merged one.

This involves FBError changes to handle cancel.

Test Plan: Run ProfilePictureView sample

Reviewers: jacl, leon, toddkrabach, vijaye

Reviewed By: vijaye

CC: security-diffs@lists, yariv

Differential Revision: https://phabricator.fb.com/D435879

Revert Plan: Safe to revert

Task ID: 990920
Fixing resource paths

Summary: The file names in the project were wrong

Test Plan: Verified project builds

Reviewers: mmarucheck, jacl

Reviewed By: mmarucheck

CC: yariv

Differential Revision: https://phabricator.fb.com/D436846
Session implementation part 1 -- main impl

Summary:
This diff contains the main portion of the new Session implementation. This includes
all of the core login UX, and parity with Facebook.m Follow-on parts are -
  part 2 -- refactored Facebook class + sample app
  part 3 -- (After first FBRequest checkin), internal notification support

Test Plan: Local sample application used to run through the new codepaths manually

Reviewers: mmarucheck, vijaye, gregschechte, toddkrabach, leon

Reviewed By: mmarucheck

CC: yariv

Differential Revision: https://phabricator.fb.com/D437941

Task ID: 958460
Add switch to framework build script to build for debug + bug fixes

Summary:
Add support for Debug and Release parameters to build_framework.sh,
also fixed typo in private property that yield broken retain behavior
for block, as well as defect in token expiration check logic

Test Plan: manual testing of script, whitebox testing of bug fixes

Reviewers: mmarucheck, vijaye

Reviewed By: vijaye

Differential Revision: https://phabricator.fb.com/D441130

Task ID: 958460
Adds a simple login sample, and reflects changes to session object block handling

Summary:
Two changes in this revision: a new sample, tweaks to session behavior

Sample app is a focused sample, which uses only the FBSession SDK class, UIKit and
Foundation. Demonstrates the common login flow for Facebook authentication, including
handling of cached tokens, as well as app-transitions to accomodate authentication.
Note: to avoid sample-bloat, a hyperlink is used to demonstrate logged-in behavior.

Test Plan: manual testing of sample on simulator using iPhone and iPad configurations; session changes to get automated testing in a follow-on revision

Reviewers: mmarucheck, vijaye, leon, caabernathy

Reviewed By: vijaye

CC: yariv

Differential Revision: https://phabricator.fb.com/D441344

Task ID: 958460, 955035
Fix build_distribution missing file, added .pmdoc

Summary:
There were two issues earlier:
- build_distribution.sh referenced a directory that did not get checked in.
- the resulting .pkg required root access but did not need to.

This fixes both by removing the unused directory reference and using .pmdoc
to generate the .pkg.  The .pmdoc allows finer tuning of the install
experience.

Test Plan: Run the script, install.

Reviewers: jacl, gregschechte, vijaye

Reviewed By: jacl

CC: security-diffs@lists

Differential Revision: https://phabricator.fb.com/D441675

Revert Plan: Safe to revert.

Task ID: 1006546
Disk Cache and tests

Summary:
This is an SQLite based index and disk cache that keeps the MRU data blobs around, keyed off URL.

I plan to put the cache underneath FBURLConnection, when we identify CDN urls.  This will be useful (in fact, necessary)  when implementing friend picker for people with 1000s of friends - we can't keep all the images we fetch in memory.

Test Plan: Unit tests

Reviewed By: leon

Differential Revision: https://phabricator.fb.com/D439170
Places picker control - Headers

Summary:
Headers for review

FBPlacesPicker: A UI control that allows users to pick a place.  The notification is sent via a delegate that clients can listen to and dismiss the view controller that hosts this view.

(more comments inline)

Test Plan: None for headers

Reviewers: jacl, mmarucheck, gregschechte

Reviewed By: jacl

CC: ekoneil

Differential Revision: https://phabricator.fb.com/D441662
Reimplements Facebook in terms of Session

Summary:
As part of our migration to the new SDK design, Facebook class is now implemented in terms of
FBSession. Note that the interface to the Facebook class remains consistent, and the implementation
will be migrated further in a follow-on checkin related to FBRequest, and then again down the road
when we update FBDialog.

Test Plan: Manual testing of Hackbook, with whiteboxing all three login modes, token expiration, KVO, etc.

Reviewers: mmarucheck, vijaye, gregschechte, yariv, caabernathy

Reviewed By: mmarucheck

CC: yariv

Differential Revision: https://phabricator.fb.com/D442255

Task ID: 958460
Places picker control

Summary:
A control that allows users to pick a place given location coordinates and a bunch of other graph parameters.  The place pick callback is performed via a delegate, which gets called for every place that is picked.

The contract is that the picked place will be returned as an NSDictioanry.  This would be superseded by the actual Place entity, when we have it.

The pictures are loaded asynchronously and the graph url to CDN url mapping is cached.  The actual image itself is not cached by this control - which is a key goal.  The image will be cached by the underlying FBURLConnection object (not yet done).

Reasonable defaults have been picked for the presentation.

Test Plan: I have a sample app that I used to test this.  I will be polishing that up as an official sample.

Reviewers: leon, jacl, mmarucheck, toddkrabach

Reviewed By: jacl

CC: gregschechte, yariv

Differential Revision: https://phabricator.fb.com/D443097
Fixing attributes

Summary: Attributes were set incorrectly for some files.  Fixing them.

Test Plan: Verify attributes manually

Reviewers: mmarucheck, jacl

Reviewed By: jacl

CC: gregschechte

Differential Revision: https://phabricator.fb.com/D443503
Implement FBRequest and FBRequestConnection

Summary:
Implementation of FBRequest and FBRequestConnection, including
partial Facebook(class) integration.  The only known remaining
integration is to pass Facebook's session to requests.

Test Plan:
Request sample, success and error paths.
Hackbook basics after session integration is available.

Reviewers: jacl, gregschechte, leon, toddkrabach, vijaye, yariv

Reviewed By: jacl

CC: security-diffs@lists, yariv

Differential Revision: https://phabricator.fb.com/D442338

Revert Plan: Safe to revert

Task ID: 992432
Fixing the Stackflow tag -- s/android/ios

Test Plan: click on Stackoverflow link; goes to the right place

Reviewers: jacl, vijaye, mmarucheck

Reviewed By: jacl

Differential Revision: https://phabricator.fb.com/D443575